I remember. But what I do not remember is if the compiler was aware of it. I remember you had these ReadOnlyVariable, subclass of association that redefined #value:. You were however still capable of doing:
MyReadOnlyVar := 1. > On 8 dic 2015, at 5:29 p.m., Marcus Denker <[email protected]> wrote: > > Hi, > > There used to be a mechanism for that (readonly variable bindings). > > It was there but not used: half the globals where readonly, all globals added > after the experiment was done where “normal”. > > With the new “first class” variables we could easily add that back in a clean > way. > > Marcus > >> On 08 Dec 2015, at 17:19, Nicolai Hess <[email protected] >> <mailto:[email protected]>> wrote: >> >> Object := nil >> >> you can evaluate that piece of code, but afterwards .... >> >> Opal checks for assignments to read only variables (method arguments for >> example) >> and signals an error if you try to modify those vars. >> But it does not check globals. >> >> Should all Globals (OCLiteralVariable with isGlobalVar == true) be read only >> ? >> or can we distinguish global vars and class bindings? >> >
