diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-10-26 06:13:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-10-26 06:13:36 -0700 |
commit | 20fea2acbc43c333ddc35b137a5b822eb5e470c0 (patch) | |
tree | 48e1e43b1d075a68541f2b12f9d548c8a97869b1 | |
parent | 8528e8f805f4f5d04d58e692ea94222946c43eca (diff) | |
download | txr-20fea2acbc43c333ddc35b137a5b822eb5e470c0.tar.gz txr-20fea2acbc43c333ddc35b137a5b822eb5e470c0.tar.bz2 txr-20fea2acbc43c333ddc35b137a5b822eb5e470c0.zip |
op/do: nice error if arguments are not provided.
* share/txr/stdlib/op.tl (sys:op-expand): Throw error if
argument list is empty. We refer to the compile-error
function by quote to avoid triggering the auto-load of
the module which defines it, due to the circular dependency
on op.
-rw-r--r-- | share/txr/stdlib/op.tl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/share/txr/stdlib/op.tl b/share/txr/stdlib/op.tl index e9ea8415..eb017cf4 100644 --- a/share/txr/stdlib/op.tl +++ b/share/txr/stdlib/op.tl @@ -82,6 +82,8 @@ (syntax-2 (sys:op-alpha-rename f e syntax-1 t)) (metas (slot ctx 'gens)) (rest-sym (sys:ensure-op-arg ctx 0))) + (unless args + ['compile-error f "arguments required"]) ^(lambda (,*(cdr metas) . ,rest-sym) ,(let ((fargs (cdr (cdr syntax-2)))) (cond |