Re: Loop Alternatives



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
.



Relevant Pages

  • Re: Style question: LOOP and multiple values
    ... With a 'smarter' LOOP macro ... > the problem would be reduced to do something clever with ... Just have LOOP look into the form-to-be-destructured. ...
    (comp.lang.lisp)
  • Re: Loop Alternatives
    ... specification is pretty vague on the specifics of "loop" and as such, ... Ken Pittman writes: ... the syntax as simple and important to be uncluttered by the extra parens. ... Has anyone implemented a loop macro using this syntax? ...
    (comp.lang.lisp)
  • Loop Alternatives
    ... specification is pretty vague on the specifics of "loop" and as such, ... Ken Pittman writes: ... the syntax as simple and important to be uncluttered by the extra parens. ... Has anyone implemented a loop macro using this syntax? ...
    (comp.lang.lisp)
  • Re: SETF and variable issues in Self Similar program.
    ... | the LOOP macro, is APPEND as a LOOP command as ... | inefficient as APPEND in its normal sense outside of the LOOP macro? ... Probably not *quite* as inefficient, ...
    (comp.lang.lisp)
  • Preview chapter about the structured syntax definition of Seed7
    ... I am writing a chapter about the structured syntax definition ... will be used as base to explain the S7SSD. ... that a new statement, the 'loop' statement, should be defined. ... Priority and assoziativity ...
    (comp.compilers)