repl: Add sc-expand meta command, include syntax-case.

* module/mes/repl.mes (,sc-expand): New meta command.
* scripts/repl.mes: Include psyntax-0, psyntax-1, psyntax.  Not used as
  basis for match yet.
This commit is contained in:
Jan Nieuwenhuizen 2016-10-30 16:18:59 +01:00
parent 32214ff608
commit 0bf26fa7d2
2 changed files with 17 additions and 0 deletions

View file

@ -94,6 +94,7 @@ along with Mes. If not, see <http://www.gnu.org/licenses/>.
"Help Commands:
,expand SEXP - Expand SEXP
,sc-expand SEXP - SC-expand SEXP
,help - Show this help
,show TOPIC - Show info on TOPIC [c, w]
")
@ -118,6 +119,17 @@ along with Mes. If not, see <http://www.gnu.org/licenses/>.
(newline))
(display (expand-macro sexp))
(newline)))
(define (scexpand)
(let ((sexp (read-env (current-module))))
(when #t print-sexp?
(display "[sexp=")
(display sexp)
(display "]")
(newline))
(display (sc-expand sexp))
(newline)))
(define (help) (display help-commands))
(define (show)
(define topic-alist `((#\newline . ,show-commands)
@ -127,6 +139,7 @@ along with Mes. If not, see <http://www.gnu.org/licenses/>.
(display (assoc-ref topic-alist topic))))
(define (meta command)
(let ((command-alist `((expand . ,expand)
(sc-expand . ,scexpand)
(help . ,help)
(show . ,show))))
((or (assoc-ref command-alist command)

View file

@ -34,5 +34,9 @@ exit $?
(mes-use-module (mes match))
(mes-use-module (mes repl))
(mes-use-module (mes psyntax-0))
(mes-use-module (mes psyntax))
(mes-use-module (mes psyntax-1))
(repl)
()