doing stupid things (image will become unusable)
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?
I had this semester a lot of students having the same problem⦠Iâm +1 to fix it.
On 8 dic 2015, at 5:19 p.m., Nicolai Hess <nicolaihess@gmail.com> 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?
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 <nicolaihess@gmail.com> 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?
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 <marcus.denker@inria.fr> 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 <nicolaihess@gmail.com <mailto:nicolaihess@gmail.com>> 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?
Yes, I wondered why it was not done in semantic analysis⦠would be much easier. The binding approach only takes care of reflective change (Smalltalk globals at: Object put: nil), a case that is not as important to fix. (reflection is dangerous, disallowing just this one operation does not help). We should do some experiments. Marcus
On 08 Dec 2015, at 17:33, Guillermo Polito <guillermopolito@gmail.com> wrote:
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 <marcus.denker@inria.fr <mailto:marcus.denker@inria.fr>> 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 <nicolaihess@gmail.com <mailto:nicolaihess@gmail.com>> 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?
2015-12-08 17:44 GMT+01:00 Marcus Denker <marcus.denker@inria.fr>:
Yes, I wondered why it was not done in semantic analysis⦠would be much easier.
The binding approach only takes care of reflective change (Smalltalk globals at: Object put: nil), a case that is not as important to fix. (reflection is dangerous, disallowing just this one operation does not help).
We should do some experiments.
by the way, what is the difference between LiteralVariable : isGlobal and isGlobalVariable ?
Marcus
On 08 Dec 2015, at 17:33, Guillermo Polito <guillermopolito@gmail.com> wrote:
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 <marcus.denker@inria.fr> 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 <nicolaihess@gmail.com> 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?
On 09 Dec 2015, at 22:23, Nicolai Hess <nicolaihess@gmail.com> wrote:
2015-12-08 17:44 GMT+01:00 Marcus Denker <marcus.denker@inria.fr <mailto:marcus.denker@inria.fr>>: Yes, I wondered why it was not done in semantic analysis⦠would be much easier.
The binding approach only takes care of reflective change (Smalltalk globals at: Object put: nil), a case that is not as important to fix. (reflection is dangerous, disallowing just this one operation does not help).
We should do some experiments.
by the way, what is the difference between LiteralVariable : isGlobal and isGlobalVariable ?
This is a leftover / to be cleanup method from the change to allow variables to get meta-links. I should clean that up. The problem is that after the month in Chile I now have to work on all the things that I postponed (and other boring stuff). Marcus
Le 8/12/15 17:29, Marcus Denker a écrit :
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.
Pleassssssssse it would be gorgeous :)
Marcus
On 08 Dec 2015, at 17:19, Nicolai Hess <nicolaihess@gmail.com <mailto:nicolaihess@gmail.com>> 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?
i AM MORE INTERESTED IN WHAT STATE HER CONSCIOUSNESS IS INAFTER TRICKING HER? If there is true loss of perceptory connection with the mirage, real pratyahara, there may still be a seed of meditation, so called Sabija Samadhi. It is not clear to me whether there actually is - messages sent without an Object??? Or is it blocked from finishing that operation and so there is no Nirbija Samadhi, not to speak loudly of Dharma Megha Samadhi! Wir Sind Tot! Alice ist jetzt Bardo! Nameste . On 12/08/2015 11:19 AM, Nicolai Hess 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?
Nicolai Hess-3 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?
I hope you will distinguish between class bindings and variable bindings (to classes). e.g. *StringClass :=String.* and *StringClass := Unicode.* should continue to be usable. (Assuming that classes named #String and #Unicode do exist, of course.) -- View this message in context: http://forum.world.st/doing-stupid-things-image-will-become-unusable-tp48660... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
2015-12-14 16:30 GMT+01:00 Richard Sargent < richard.sargent@gemtalksystems.com>:
Nicolai Hess-3 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?
I hope you will distinguish between class bindings and variable bindings (to classes).
e.g. *StringClass :=String.* and *StringClass := Unicode.* should continue to be usable. (Assuming that classes named #String and #Unicode do exist, of course.)
Created a fobgubz entry: 18376 <https://pharo.fogbugz.com/f/cases/18376/Do-not-allow-assignments-to-global-v...> Do not allow assignments to global vars
-- View this message in context: http://forum.world.st/doing-stupid-things-image-will-become-unusable-tp48660... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (6)
-
Guillermo Polito -
Marcus Denker -
Nicolai Hess -
Richard Sargent -
Robert Withers -
stepharo