From: Peter Seibel
Subject: 'it' in LOOP BNF
Date: 
Message-ID: <m37k9kziq0.fsf@javamonkey.com>
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

From: Peter Seibel
Subject: Re: 'it' in LOOP BNF
Date: 
Message-ID: <m365p4xqev.fsf@javamonkey.com>
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
From: Wolfhard Buß
Subject: Re: 'it' in LOOP BNF
Date: 
Message-ID: <m3of2wgvzf.fsf@buss-14250.user.cis.dfn.de>
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)
From: Peter Seibel
Subject: Re: 'it' in LOOP BNF
Date: 
Message-ID: <m3el3sxqn4.fsf@javamonkey.com>
·····@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