1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 10:07:45 +03:00
mal/elisp/step0_repl.el

31 lines
559 B
EmacsLisp
Raw Normal View History

2016-02-28 23:21:38 +03:00
(defun READ (input)
input)
(defun EVAL (input)
input)
(defun PRINT (input)
input)
(defun readln (prompt)
;; C-d throws an error
(ignore-errors (read-from-minibuffer prompt)))
(defun println (format-string &rest args)
(if (not args)
(princ format-string)
(princ (apply 'format format-string args)))
(terpri))
(defun main ()
(let (eof)
(while (not eof)
(let ((input (readln "user> ")))
(if input
(println input)
(setq eof t)
;; print final newline
(terpri))))))
(main)