B. Pym
2024-08-28 00:49:14 UTC
I'm not advocating tail-recursion instead of specialized iteration
mechanisms closer to the problem domain. I'm just saying tail-
recursion code isn't anywhere as low-level as you're making it up to
be.
It actually is, and your posting below shows it very nicely.mechanisms closer to the problem domain. I'm just saying tail-
recursion code isn't anywhere as low-level as you're making it up to
be.
(loop for (key value) on property-list by #'cddr
unless (member key excluded-keys)
append (list key value)) ; [1]
unless (member key excluded-keys)
append (list key value)) ; [1]
(loop for (key value) on property-list by #'cddr
unless (member key excluded-keys)
nconc (list key value)))
(filter '(c d) '(a 1 b 2 b 3 c 4 d 5 c 6))
(A 1 B 2 B 3)The result is a correct property list
(define (remove-props bad-keys prop-list)
(concatenate
(remove (^p (member (car p) bad-keys))
(slices prop-list 2))))
(remove-props '(c d) '(a 1 b 2 b 3 c 4 d 5 c 6))
===>
(a 1 b 2 b 3)