From: David Bakhash
Subject: loop macro and `being the...'
Date: 
Message-ID: <cxjg1fc3gmw.fsf@engc.bu.edu>
hey,

in the elisp implementation of loop I can do this:

(setq vec (vector 1 2 5 6))

(loop for elem being the elements of vec
      ...)

and so "being the elements" works for sequences.  I loved that, the
same way I like to use `elt' when I don't feel like remembering what
data structure I used.  How do I do that with the CL version of loop?
(specifically in Allegro CL)

thanks,
dave
From: Rainer Joswig
Subject: Re: loop macro and `being the...'
Date: 
Message-ID: <joswig-0408981836560001@pbg3.lavielle.com>
In article <···············@engc.bu.edu>, David Bakhash <·····@bu.edu> wrote:

> hey,
> 
> in the elisp implementation of loop I can do this:
> 
> (setq vec (vector 1 2 5 6))
> 
> (loop for elem being the elements of vec
>       ...)
> 
> and so "being the elements" works for sequences.  I loved that, the
> same way I like to use `elt' when I don't feel like remembering what
> data structure I used.  How do I do that with the CL version of loop?
> (specifically in Allegro CL)
> 
> thanks,
> dave

For vectors use:

(loop for item across (vector 1 2 3)
      collect item)

A sequence version? Doesn't exist, I think.