commit 99d76c4b1c33899c5de4e2aaad12d602381dcd21 parent 2e1a393a6f75838797a9ab12a29edea7a91821f2 Author: Ed van Bruggen <edvb@uw.edu> Date: Sun, 25 Oct 2020 16:31:14 -0700 defmacro error on incorrect format Diffstat:
tib/core.tsp | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tib/core.tsp b/tib/core.tsp @@ -1,9 +1,15 @@ +;;; core.tsp (def (list . lst) lst) (def quit "type (quit) or press CTRL-D to exit REPL") (def defmacro (macro (args . body) - (list 'def (car args) (list 'macro (cdr args) . body)))) + (cond + ((pair? args) + (list 'def (car args) (list 'macro (cdr args) . body))) + (else + (error 'defmacro "expected macro name and argument List, recieved " + (typeof args)))))) ;;; CXR