In the BNF for the extended LOOP macro (CLHS, LOOP, s.v.) there are a
number of productions with '{ form | it }'. For instance:
unconditional::= {do | doing} compound-form+ | return {form | it}
^^
This same construction also appears in the list-accumulation and
numeric-accumulation productions.
In the printed version of the spec, the 'it' is in the same typeface
as the the other "loop keywords". That seems to imply that you could
say something like:
(loop for i upto 10 return it)
But in the discussion of Unconditional Execution Clauses in 6.1.5 it
says simply: "The return construct takes one form." There is no
mention of 'it' or what it would mean.
Based on a quick test in ACL and CLISP it seems that folks are going
by the 6.1.5, not the BNF. Is the grammar wrong? (I googled for
discussion of this before but it's hard to find things where one of
the key phrases is 'it'. :-|)
-Peter
--
Peter Seibel ·····@javamonkey.com
The intellectual level needed for system design is in general
grossly underestimated. I am convinced more than ever that this
type of work is very difficult and that every effort to do it with
other than the best people is doomed to either failure or moderate
success at enormous expense. --Edsger Dijkstra
Peter Seibel <·····@javamonkey.com> writes:
> In the BNF for the extended LOOP macro (CLHS, LOOP, s.v.) there are a
> number of productions with '{ form | it }'. For instance:
>
> unconditional::= {do | doing} compound-form+ | return {form | it}
> ^^
>
> This same construction also appears in the list-accumulation and
> numeric-accumulation productions.
>
> In the printed version of the spec, the 'it' is in the same typeface
> as the the other "loop keywords". That seems to imply that you could
> say something like:
>
> (loop for i upto 10 return it)
BTW, I had no idea what I expected that expression to do. I was just
stupidly generating "legal" sentences based on the BNF without having
seen the bit in 6.1.6 about the proper use of 'it'. Sorry about that.
-Peter
--
Peter Seibel ·····@javamonkey.com
The intellectual level needed for system design is in general
grossly underestimated. I am convinced more than ever that this
type of work is very difficult and that every effort to do it with
other than the best people is doomed to either failure or moderate
success at enormous expense. --Edsger Dijkstra
Peter Seibel <·····@javamonkey.com> writes:
> In the BNF for the extended LOOP macro (CLHS, LOOP, s.v.) there are a
> number of productions with '{ form | it }'. For instance:
>
> unconditional::= {do | doing} compound-form+ | return {form | it}
:
> That seems to imply that you could say something like:
>
> (loop for i upto 10 return it)
CLHS 6.1.6 Conditional Execution Clauses:
`The loop keyword it can be used to refer to the result of the test
expression in a clause. Use the loop keyword it in place of the form
in a return clause or an accumulation clause that is inside a
conditional execution clause. If multiple clauses are connected with
and, the it construct must be in the first clause in the block.'
--
"Hurry if you still want to see something. Everything is vanishing."
-- Paul C�zanne (1839-1906)
·····@gmx.net (Wolfhard Bu�) writes:
> Peter Seibel <·····@javamonkey.com> writes:
>
> > In the BNF for the extended LOOP macro (CLHS, LOOP, s.v.) there are a
> > number of productions with '{ form | it }'. For instance:
> >
> > unconditional::= {do | doing} compound-form+ | return {form | it}
> :
> > That seems to imply that you could say something like:
> >
> > (loop for i upto 10 return it)
>
> CLHS 6.1.6 Conditional Execution Clauses:
>
> `The loop keyword it can be used to refer to the result of the test
> expression in a clause. Use the loop keyword it in place of the form
> in a return clause or an accumulation clause that is inside a
> conditional execution clause. If multiple clauses are connected with
> and, the it construct must be in the first clause in the block.'
Ah, perfect. Thanks.
-Peter
--
Peter Seibel ·····@javamonkey.com
The intellectual level needed for system design is in general
grossly underestimated. I am convinced more than ever that this
type of work is very difficult and that every effort to do it with
other than the best people is doomed to either failure or moderate
success at enormous expense. --Edsger Dijkstra