From 8900e25269d7fda56b9fe567df01b26b3d110313 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 26 Oct 2017 06:13:36 -0700 Subject: 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. --- share/txr/stdlib/op.tl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') 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 -- cgit v1.2.3