[Oberon] Intermediate scopes in Oberon-07

Diego Sardina dsar at eml.cc
Mon Feb 26 13:35:26 CET 2018


On Mon, Feb 26, 2018, at 12:15 PM, Артур Ефимов wrote:
> Diego Sardina wrote:
> >
> In the past I never saw procedure variables as a solution for circular reference, but at this point I prefer forward reference.
> 
> >
> Also they don't really come for free especially in runtime, it is another level of indirection and they prevent the compiler to inline them.
> 
> T
> he compiler can't inline these procedures anyway, as they are involved in recursion (and thus have to be forward-referenced in some way).
> 

I didn't say or mean that local procedures are ALWAYS nested by the compiler, but there are some cases where they can be. Instead procedure variables can't be inlined, always.

> 
> I'm using procedure variables in my Oberon compiler, like N. Wirth does in Project Oberon. Didn't think about nesting all of these procedures inside Expression.
> 

Weird, since this is what makes more sense. There are a lot of nice books in Pascal and Modula-2 where those procedures are nested inside Expression. This is historical, not something new :-)

> 
> By the way, does anybody know why in NW's compiler procedures "expression0", "
> qualident
> ", "selector", "element", "set", "factor", "term" (but not "SimpleExpression" for example) 
> start from a small letter?
> 

They reflect the names used in the grammar



More information about the Oberon mailing list