(mac between (var expr within . body) (w/uniq first `(let ,first t (each ,var ,expr (unless ,first ,within) (wipe ,first) ,@body))))
I’ve been running into this pattern in my code often enough that I thought I’d make it into a macro.
arc> (between a '(1 2 3 4) (pr ",") (pr a)) 1,2,3,4nil
Or, using the hackinator:
hack ycombinator.com/arc/arc3.1.tar \ awwx.ws/between0.arc
This code may be redistributed and modified under the same terms as Arc itself.