[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bill Schelter has produced a lovely Common Lisp substitute
for the Maclisp/Zetalisp loop construct called sloop. It is
mostly upwards compatible with loop.
Sloop sources may be found in the file
The code is free. It was written by Schelter from scratch
and is hence definitely free of any MIT or lisp machine
company copyright claim.
Like the original I.S.OPR facility in Interlisp, the sloop
construct permits the addition of new "collection" type
operators; for example, an averaging operation is defined.
A very general facility different from that of loop's has
been implemented to provide user extensible iteration paths.
One can map over tree fringes, Common Lisp hash tables, or
(sloop for sym in-package 'user when (fboundp sym) collect sym).
A "cross-product" concept has been added.
Instead of writing something like:
(loop for x in (l1) nconc (loop for y in (l2) collect (fn x y)))
one may write:
(sloop for x in (l1) sloop (for y in (l2) collect (fn x y)))
Only one "collection site" is created and used during
these two nested iterations.
Like the original loop, sloop takes advantage of locatives
to do collection more efficiently when they are available,
e.g., on MIT type lisp machines.
Sloop has been run in at least four dialects of Common Lisp
on three different kinds of machines.
I believe Schelter is definitely interested in reports of
bugs and suggestions for improvements. Mail will reach him
at email@example.com or at the Mathematics
Department, University of Texas at Austin, Austin, Texas