[Oberon] Re (2): LONGINT, RETURN & etc.

Chris Burrows chris at cfbsoftware.com
Sun Jun 18 01:21:11 CEST 2017


> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> peter at easthope.ca
> Sent: Sunday, 18 June 2017 1:02 AM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] Re (2): LONGINT, RETURN & etc.
> 
> From:	Chris Burrows <chris at cfbsoftware.com>
> Date:	Sat, 17 Jun 2017 13:55:16 +0930
> > http://www.astrobe.com/OberonSyntax/html/OberonSyntax.htm
> 
> Date:	Sat, 17 Jun 2017 13:40:15 +0930
> > What you can't have is just RETURN without an expression.
> 
> According to your diagrams an expression can be factor and a factor
> can be NIL or " ". So "RETURN END" is OK.  Interesting edge case!
> 

No. 

NIL is a reserved word representing a null POINTER, " " is a blank CHAR.
They do not denote that 'expression' is optional.

  RETURN NIL END is valid 

  RETURN " " END is valid 

  RETURN END is not valid

If expressions were optional then statements like 

  IF THEN DoSomething END;

  FOR i := TO BY DO DoSomething END;

would also be syntactically correct!

Regards,
Chris Burrows
CFB Software
http://www.astrobe.com




More information about the Oberon mailing list