[Aldor-l] Semicolon after single statement in if?

Pippijn van Steenhoven pip88nl at gmail.com
Wed May 6 19:37:49 EDT 2009


On Wed, May 06, 2009 at 03:24:28PM -0700, David Casperson wrote:
> hi folks,
>
> I don't have definite proof that it is legal, but I seem to remember that
>
>       x:=3 ; ++ post
>              ++ document
>
> is a legal expression, and consequently could be substituted for Y in
>
> if Z then Y else other ;
>
> If that is the case
>
>        x:=3 ;
>
> may reduce to an expression (that is followed by a list of zero  
> post-documents).
>
> Does this help?
>
> David
> -- 
> David Casperson,
> UNBC

Hi,

x := 3; ++ post document

as far as I can tell from the grammar, this would be a

   CurlyContentA (Labelled): CurlyContentB (Labelled) ";" PostDocument

and not an expression. I don't see how a CurlyContents (which is what it
becomes in the end) can become an expression. However, what makes me
think is that the Aldor compiler actually uses this grammar and it
accepts the code, but why? How can it do that? Also, I can see reductions
from "x := 3;" to an AnyStatement but not to BalStatement, which is
required by "if". I am tired, so I will look again, tomorrow, maybe I can
find it.

-- 
Pippijn van Steenhoven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20090507/06712b35/attachment-0002.bin>


More information about the Aldor-l mailing list