Re: Loop Alternatives
- From: "John Thingstad" <jpthing@xxxxxxxxx>
- Date: Fri, 30 May 2008 20:10:14 +0200
På Thu, 29 May 2008 23:47:24 +0200, skrev localhost <gjwatersjr@xxxxxxxxxxxxxxx>:
I've been reading through older posts here for alternatives to the
loop macro and found the following:
Ted Sandler <tedsand...@xxxxxxx> 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
.
- References:
- Loop Alternatives
- From: localhost
- Loop Alternatives
- Prev by Date: Re: C++ program as a Lisp expression
- Next by Date: Re: Are we close to a Lisp boom ?
- Previous by thread: Re: Loop Alternatives
- Next by thread: Re: blogs, longbets.org, and education of sociology
- Index(es):
Relevant Pages
|