repl: Fix expand in repl.

* module/mes/repl.mes (repl): Fix expand.  Remove sc-expand.
This commit is contained in:
Jan Nieuwenhuizen 2017-01-22 01:35:33 +01:00
parent 712403752d
commit e74a7584e9

View file

@ -96,7 +96,6 @@ along with Mes. If not, see <http://www.gnu.org/licenses/>.
"Help Commands: "Help Commands:
,expand SEXP - Expand SEXP ,expand SEXP - Expand SEXP
,sc-expand SEXP - SC-expand SEXP
,help - Show this help ,help - Show this help
,show TOPIC - Show info on TOPIC [c, w] ,show TOPIC - Show info on TOPIC [c, w]
,use MODULE - load MODULE ,use MODULE - load MODULE
@ -113,25 +112,16 @@ along with Mes. If not, see <http://www.gnu.org/licenses/>.
(let ((count 0) (let ((count 0)
(print-sexp? #t)) (print-sexp? #t))
(define (expand) (define (expand a)
(lambda ()
(let ((sexp (read))) (let ((sexp (read)))
(when #t print-sexp? (when #t print-sexp?
(display "[sexp=") (display "[sexp=")
(display sexp) (display sexp)
(display "]") (display "]")
(newline)) (newline))
(display (core:macro-expand sexp)) (display (eval (list core:macro-expand sexp) a))
(newline))) (newline))))
(define (scexpand)
(let ((sexp (read)))
(when #t print-sexp?
(display "[sexp=")
(display sexp)
(display "]")
(newline))
(display (sc-expand sexp))
(newline)))
(define (help . x) (display help-commands)) (define (help . x) (display help-commands))
(define (show . x) (define (show . x)
@ -145,8 +135,7 @@ along with Mes. If not, see <http://www.gnu.org/licenses/>.
(let ((module (read))) (let ((module (read)))
(mes-load-module-env module a)))) (mes-load-module-env module a))))
(define (meta command a) (define (meta command a)
(let ((command-alist `((expand . ,expand) (let ((command-alist `((expand . ,(expand a))
(sc-expand . ,scexpand)
(help . ,help) (help . ,help)
(show . ,show) (show . ,show)
(use . ,(use a))))) (use . ,(use a)))))