mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 09:15:32 +01:00
Previously the interactive mode looped on a READ fail Now inner READ errors are treated as unrecoverable and cause the reader to reset Signed-off-by: teo3300 <matteo.rogora@live.it>
18 lines
352 B
Plaintext
18 lines
352 B
Plaintext
;; Previously in core.rs
|
|
(def! not (fn* [x]
|
|
(if x nil true)))
|
|
|
|
(def! empty? (fn* [l]
|
|
(= (count l) 0)))
|
|
|
|
;; File-interaction functions
|
|
(def! load-file (fn* [f]
|
|
(eval (read-string (str "(do\n" (slurp f) "\nnil)")))))
|
|
|
|
(def! conf-reload (fn* []
|
|
(load-file (str MAL_HOME "/" "config.mal"))))
|
|
|
|
;; Shorthand
|
|
(def! quit (fn* []
|
|
(exit 0)))
|