From: Marty Kent
Subject: Looking for Common Lisp iteration macros
Date: 
Message-ID: <23319@ucbvax.BERKELEY.EDU>
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
		·····@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.
From: Douglas J Roberts
Subject: Re: Looking for Common Lisp iteration macros
Date: 
Message-ID: <16786@beta.UUCP>
In article <·····@ucbvax.BERKELEY.EDU>, ·····@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
····@lanl.gov