[Oberon] Expression to the left of the variable

Diego Sardina dsar at eml.cc
Fri May 7 14:38:38 CEST 2021


On Thu, May 6, 2021, at 3:57 AM, eas lab wrote:
> it's what you get used to.
> For decades I was comfortable with Pascal syntax.
> Now it looks klunky & I want syntax-coloring to distinguish it's
>  function/arguments/result.
> IMO `poplog` has the clearest syntax:
>   "a+1->b"  is better than "b :=a+1"

Yes, older languages had this syntax.

This is also mentioned in Wirth's compiler book but left as exercise.
I would like to discuss it with you (all) since I wasn't sure of my answers.

----
10.2. Had the assignment statement in Oberon been defined in a form where the assigned expression occurs to the left of the variable, that is for example by the form  e =: v, would compilation of assignments be simpler in any way? 

10.3. Consider the introduction of a multiple assignment in Oberon of the form e =: x0 =: x1 =:  ...  =: xn. Implement it. Does the definition of its semantics present any problems?
----

My answer for the first is that it simplifies the code generation for the assignment since it follows the flow and in the second I don't see any problems in its semantics.
In general I see only advantages in both for lexing, parsing and code generation.

What are your answers?

--
Diego Sardina


More information about the Oberon mailing list