I've been reading through older posts here for alternatives to the
loop macro and found the following:
Ted Sandler <··········@rcn.com> writes:
>> Okay, is "loop" useful? Paul Graham mentions that the ANSI
>> specification is pretty vague on the specifics of "loop" and as such,
>> its use can't be recommended, etc.
Ken Pittman writes:
>It's controverisal, but my opinion is "yes, it's useful".
>I used to not like it but was gradually won over, though I think good
>style means avoiding using its total power and sticking to things that
>are straightforward to read.
>The reason some people don't like it is simple syntax--it's not grouped.
>Something like
>(loop for i from 0 to 100 for j from 3 for z in z-list do (something))
>ought, some say, be grouped like
> (loop (for i (from-to 0 100))
> (for j (from 3))
> (for z (in z-list))
> (do (something)))
>or at least
>(loop :for ((i :from 0 :to 100)
> (j :from 3)
> (z :in z-list))
> :do (something))
>so that Emacs can more easily indent it or so that programs didn't need
>a special parser to understand it. Nevertheless, loop advocates defend
>the syntax as simple and important to be uncluttered by the extra parens.
...I think the first grouped example Pittman provides is beautiful.
Has anyone implemented a loop macro using this syntax? Also, links to
any other loop alternatives would be appreciated.
In article
<····································@c19g2000prf.googlegroups.com>,
localhost <··········@frontiernet.net> wrote:
> I've been reading through older posts here for alternatives to the
> loop macro and found the following:
>
> Ted Sandler <··········@rcn.com> writes:
> >> Okay, is "loop" useful? Paul Graham mentions that the ANSI
> >> specification is pretty vague on the specifics of "loop" and as such,
> >> its use can't be recommended, etc.
>
> Ken Pittman writes:
> >It's controverisal, but my opinion is "yes, it's useful".
>
> >I used to not like it but was gradually won over, though I think good
> >style means avoiding using its total power and sticking to things that
> >are straightforward to read.
>
> >The reason some people don't like it is simple syntax--it's not grouped.
> >Something like
> >(loop for i from 0 to 100 for j from 3 for z in z-list do (something))
> >ought, some say, be grouped like
> > (loop (for i (from-to 0 100))
> > (for j (from 3))
> > (for z (in z-list))
> > (do (something)))
> >or at least
> >(loop :for ((i :from 0 :to 100)
> > (j :from 3)
> > (z :in z-list))
> > :do (something))
> >so that Emacs can more easily indent it or so that programs didn't need
> >a special parser to understand it. Nevertheless, loop advocates defend
> >the syntax as simple and important to be uncluttered by the extra parens.
>
> ...I think the first grouped example Pittman provides is beautiful.
> Has anyone implemented a loop macro using this syntax? Also, links to
> any other loop alternatives would be appreciated.
http://common-lisp.net/project/iterate/
--
http://lispm.dyndns.org/
P� Thu, 29 May 2008 23:47:24 +0200, skrev localhost
<··········@frontiernet.net>:
> I've been reading through older posts here for alternatives to the
> loop macro and found the following:
>
> Ted Sandler <··········@rcn.com> writes:
>>> Okay, is "loop" useful? Paul Graham mentions that the ANSI
>>> specification is pretty vague on the specifics of "loop" and as such,
>>> its use can't be recommended, etc.
>
> Ken Pittman writes:
>> It's controverisal, but my opinion is "yes, it's useful".
>
>> I used to not like it but was gradually won over, though I think good
>> style means avoiding using its total power and sticking to things that
>> are straightforward to read.
>
>> The reason some people don't like it is simple syntax--it's not grouped.
>> Something like
>> (loop for i from 0 to 100 for j from 3 for z in z-list do (something))
>> ought, some say, be grouped like
>> (loop (for i (from-to 0 100))
>> (for j (from 3))
>> (for z (in z-list))
>> (do (something)))
>> or at least
>> (loop :for ((i :from 0 :to 100)
>> (j :from 3)
>> (z :in z-list))
>> :do (something))
>> so that Emacs can more easily indent it or so that programs didn't need
>> a special parser to understand it. Nevertheless, loop advocates defend
>> the syntax as simple and important to be uncluttered by the extra
>> parens.
>
> ...I think the first grouped example Pittman provides is beautiful.
> Has anyone implemented a loop macro using this syntax? Also, links to
> any other loop alternatives would be appreciated.
I could add series..
http://series.sourceforge.net/
--------------
John Thingstad