summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-10-26 06:13:36 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-10-26 06:13:36 -0700
commit8900e25269d7fda56b9fe567df01b26b3d110313 (patch)
tree48e1e43b1d075a68541f2b12f9d548c8a97869b1 /share
parent0f815d2e4552c71783f302189c67db8ad34343fb (diff)
downloadtxr-8900e25269d7fda56b9fe567df01b26b3d110313.tar.gz
txr-8900e25269d7fda56b9fe567df01b26b3d110313.tar.bz2
txr-8900e25269d7fda56b9fe567df01b26b3d110313.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.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/op.tl2
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