Why aren't we all speaking LISP now?

Hannah Schroeter hannah at schlund.de
Wed May 16 09:49:45 EDT 2001


[Crossposting + F'up to c.l.lisp, as it isn't really Python related
 any more.]

Hello!

In article <3B021985.DBBB7E7F at my.signature>,
Greg Ewing  <see at my.signature> wrote:
>Courageous wrote:

>> One variant of loop has you doing:

>> (loop while (condition)
>>         )

>I also seem to remember using a (while condition ...)
>construct. I can't remember whether it was built-in
>or whether I made my own using a macro. Either way,
>it was much easier to use than (do ...), even if I
>had to spell things out more verbosely inside it.

Common Lisp has a very flexible loop macro, allowing expressions such as

(loop while (some-condition)
      do (some-action))

(loop for i from 1 to 10
      do (something-with-i))

(loop for i being the hash-keys of (some-hash-table)
      do ...
      finally ...)

etc.

See the HyperSpec for a zillion of more possibilities :-)

Kind regards,

Hannah.



More information about the Python-list mailing list