diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-17 06:23:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-17 06:23:19 -0700 |
commit | ee6ab487ef94fff4850aaef1fa08021873a14a0a (patch) | |
tree | c8e1b7fdfd050e09d8d90cb2373aabaa11b3a951 /share | |
parent | 1d2967e74413dc45bd298de7c9a9bf9f72d9ca02 (diff) | |
download | txr-ee6ab487ef94fff4850aaef1fa08021873a14a0a.tar.gz txr-ee6ab487ef94fff4850aaef1fa08021873a14a0a.tar.bz2 txr-ee6ab487ef94fff4850aaef1fa08021873a14a0a.zip |
op: tests, and fix (op progn ...) situation
* share/txr/stdlib/op.tl (op-expand): For the sake of special
processing applied to support the lop operator, the code
assumes that the expanded syntax-2 is a list with at least two
elements, such that we can do (cddr syntax-2). This is not
true for instance in (op progn).
* tests/012/op.tl: New file.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/op.tl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/txr/stdlib/op.tl b/share/txr/stdlib/op.tl index 5c231645..809a7f09 100644 --- a/share/txr/stdlib/op.tl +++ b/share/txr/stdlib/op.tl @@ -119,7 +119,8 @@ (rec (slot ctx 'rec)) (recvar (slot ctx 'recvar)) (rest-sym (sys:ensure-op-arg ctx 0)) - (lambda-interior (let ((fargs (cdr (cdr syntax-2)))) + (lambda-interior (let ((fargs (tree-case syntax-2 + ((a b . fa) fa)))) (cond ((and (eq sym 'lop) fargs) (let ((fargs-l1 (mapcar (lambda (farg) |