diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-24 10:50:02 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-24 10:50:02 -0800 |
commit | 4ce293cccc70789d68a490af2c38a9e8b82d6f7f (patch) | |
tree | 372fd160cc5db39d9748ffe09608ea3ba00a4710 /share | |
parent | 19fb18a343d88621ebab989539a3463b1ffbba7d (diff) | |
download | txr-4ce293cccc70789d68a490af2c38a9e8b82d6f7f.tar.gz txr-4ce293cccc70789d68a490af2c38a9e8b82d6f7f.tar.bz2 txr-4ce293cccc70789d68a490af2c38a9e8b82d6f7f.zip |
bugfix: use proper plist lookup in new :key macro.
* share/txr/stdlib/keyparams.tl (sys:extract-keys,
sys:extract-keys-p): Use the brand new memp function rather
than memq. memq is not correct for plist lookup because of
ambiguities like (:foo :bar :bar 3) where memq retrieves (:bar
:bar 3) for :bar rather than (:bar 3).
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/keyparams.tl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/keyparams.tl b/share/txr/stdlib/keyparams.tl index b3474c4e..fde55e0b 100644 --- a/share/txr/stdlib/keyparams.tl +++ b/share/txr/stdlib/keyparams.tl @@ -27,14 +27,14 @@ (defun sys:extract-keys (keys args) (build (each ((k keys)) - (iflet ((f (memq (car k) args))) + (iflet ((f (memp (car k) args))) (add (cadr f)) (add (cdr k)))))) (defun sys:extract-keys-p (keys args) (build (each ((k keys)) - (add (if (memq k args) t))))) + (add (if (memp k args) t))))) (defun sys:build-key-list (key-params) (let ((constant (group-by [chain second constantp] key-params))) |