by Josef Templ » Sat Dec 15, 2018 9:34 am
Another reason for treating the modifiers as predefined objects, I think, is the
existence of the NEW modifier for type-bound procedures.
NEW was already a predefined name in Oberon and was also used as such in CP.
But NEW is not only a standard procedure but is also used for marking newly added type-bound procedures.
This duality may have been an unfortunate decision but it can certainly not be changed now.
Having one modifier as a predefined object and others as keywords would be strange, wouldn't it?
In general, if the language report accidentally listed INTEGER as a keyword
I would not consider it a 'change' to fix that but rather as fixing a typo.
The practical implications are zero because no existing program can be invalidated.
The distinction between keywords and predefined objects is a subtle topic.
Why does it exist at all? I mean, why aren't for example the basic types (INTEGER, etc.) not keywords but
predefined types? In my understanding the reason for inventing and using the concept of predefined
objects is upgrade-ability. If at a later time a new basic type or standard procedure (or modifier)
needs to be added to the language it does not invalidate any existing programs that happen to use
that particular identifier.
- Josef