18 lines
No EOL
381 B
Text
18 lines
No EOL
381 B
Text
(comment This is lish core)
|
|
|
|
(def require (fn [x] (eval (str "(do " (cat x) ")"))))
|
|
|
|
(def inc (fn [x] (+ x 1)))
|
|
|
|
(def range (fn [from to]
|
|
(if (< from to)
|
|
(cons from (range (inc from) to))
|
|
[])))
|
|
|
|
(def map (fn [f lst]
|
|
(if (empty? lst)
|
|
[]
|
|
(cons (f (first lst))
|
|
(map f (rest lst))))))
|
|
|
|
(prn "LISH core loaded") |