mkent@dewey.soe.berkeley.edu (Marty Kent) (03/18/88)
I'm trying to find some reasonable iteration macros for common lisp. My recent experience is with Interlisp, and I've become extremely fond of the very general iteration constructs there (which are not, however, implemented as macros). For-loops, while-loops, etc. are all desireable. Please send to me rather than to the net; I'll post a summary to the net if I get requests to do so... Marty Kent Sixth Sense Research and Development 415/642 0288 415/548 9129 MKent@dewey.soe.berkeley.edu {uwvax, decvax, inhp4}!ucbvax!mkent%dewey.soe.berkeley.edu Kent's heuristic: Look for it first where you'd most like to find it.
dzzr@beta.UUCP (Douglas J Roberts) (03/22/88)
In article <23319@ucbvax.BERKELEY.EDU>, mkent@dewey.soe.berkeley.edu (Marty Kent) writes: > I'm trying to find some reasonable iteration macros for common lisp. My > recent experience is with Interlisp, and I've become extremely fond of > the very general iteration constructs there (which are not, however, > implemented as macros). For-loops, while-loops, etc. are all desireable. > Please send to me rather than to the net; I'll post a summary to the net > if I get requests to do so... Here's one that was bandied about the net a "while" ago. ;;; -*- Mode: LISP; Syntax: Common-lisp; Package: K -*- (defmacro while (test-form &body body) "This macro evaluates test-form, and if the result is non-nil all subsequent forms will be iteratively evaluated until test-form evaluates to nil. Example: (while (test-form) (form1) (form2) . . . )" `(do () ((not ,test-form)) ,@body)) ---------------------------------------------------- Doug Roberts Los Alamos national Laborotory dzzr@lanl.gov