styling and readme content

master
cynic 3 years ago
parent 9ea2fa85b0
commit 3ccff8371d
  1. 9
      lib/aids.klambda
  2. 37
      readme.txt
  3. 10
      test.klambda

@ -5,13 +5,10 @@ INCLUDE:./lib/loop.klambda
(defun spit (defun spit
(miracle (miracle
"builtins" "print" (id $1)) "builtins" "print" (id $1)))
)
(defun input (defun input
(miracle (miracle
"builtins" "input" ("")) "builtins" "input" ("")))
)
(defun thesis (defun thesis
(spit (spit
("this language belongs to makise kurisu. there are many like it, but this one is hers.")) ("this language belongs to makise kurisu. there are many like it, but this one is hers.")))
)

@ -1,3 +1,40 @@
this language belongs to makise kurisu. there are many like it, but this one is hers. this language belongs to makise kurisu. there are many like it, but this one is hers.
syntax:
a program is a series of functions executed using one environment -- that is, sharing
defined variables and functions.
these functions are executed homoiconic objects made up of language types:
- list, `()` and everything inside. items are delimited by whitespace.
- string, everything between `"` double quotes
- number, everything capable of being represented as a decimal float value
- identifier, everything else
lists starting with defined function identifiers are executed with the rest of the list
as parameters, i.e. (spit "hello~" (+ 9000 1)). runs `spit` using "hello" and (+ 9000 1).
the lower-order function is calculated for the higher-order one, so it ends up calling
`spit` with "hello" and 9001.
examples:
<===
(thesis)
===>
this language belongs to makise kurisu. there are many like it, but this one is hers.
<===
(def a (id (id "desu")))
(spit
("lol swej" (+ 9000 1) a))
===>
lol swej 9001.0 desu
<===
(spit "how old are you? > ")
(def age (conv number (input)))
(spit
(cond (> age 18)
"adult (hag)"
"not adult (uoh)"))
=='9' STDIN=>
not adult (uoh)

@ -2,22 +2,18 @@ INCLUDE:./lib/aids.klambda
(def a (id (id "desu"))) (def a (id (id "desu")))
(spit (spit
("lol swej" (+ 9000 1) a) ("lol swej" (+ 9000 1) a))
)
(spit (cond (= "10" (+ 1 9)) "same" "not same")) (spit (cond (= "10" (+ 1 9)) "same" "not same"))
(cond ("", (+ 0 1)) (cond ("", (+ 0 1))
(id spit "one") (id spit "one")
(id spit "zero") (id spit "zero"))
)
(spit "how old are you? > ") (spit "how old are you? > ")
(def age (conv number (input))) (def age (conv number (input)))
(spit (spit
(cond (> age 18) (cond (> age 18)
"adult (hag)" "adult (hag)"
"not adult (uoh)" "not adult (uoh)"))
)
)
loop:0:100:(spit (cond (% $1 15) (cond (% $1 5) (cond (% $1 3) $1 "fizz") "buzz") "fizzbuzz")) loop:0:100:(spit (cond (% $1 15) (cond (% $1 5) (cond (% $1 3) $1 "fizz") "buzz") "fizzbuzz"))

Loading…
Cancel
Save