doing stupid things (image will become unusable)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

doing stupid things (image will become unusable)

Nicolai Hess-3-2

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?

Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Guillermo Polito
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 <[hidden email]> 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?


Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Marcus Denker-4
In reply to this post by Nicolai Hess-3-2
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 <[hidden email]> 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?


Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Guillermo Polito
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 <[hidden email]> 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 <[hidden email]> 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?



Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Marcus Denker-4
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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?




Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Robert Withers
In reply to this post by Nicolai Hess-3-2
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?
>


Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

stepharo
In reply to this post by Marcus Denker-4


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 <[hidden email]> 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?



Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Nicolai Hess-3-2
In reply to this post by Marcus Denker-4


2015-12-08 17:44 GMT+01:00 Marcus Denker <[hidden email]>:
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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?





Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Marcus Denker-4

On 09 Dec 2015, at 22:23, Nicolai Hess <[hidden email]> wrote:



2015-12-08 17:44 GMT+01:00 Marcus Denker <[hidden email]>:
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

Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Richard Sargent
Administrator
In reply to this post by Nicolai Hess-3-2
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.)

Reply | Threaded
Open this post in threaded view
|

Re: doing stupid things (image will become unusable)

Nicolai Hess-3-2


2015-12-14 16:30 GMT+01:00 Richard Sargent <[hidden email]>:
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 Do not allow assignments to global vars

 



--
View this message in context: http://forum.world.st/doing-stupid-things-image-will-become-unusable-tp4866090p4866994.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.