ReadingOnlyVariableBindings

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

ReadingOnlyVariableBindings

Colin Putney-3
Hi everyone,

One oddity I discovered while working on Environments is that, when a binding is converted to read-only or read-write, all the methods that refer to that binding are recompiled. 

Does anybody know why this is done?

Colin


Reply | Threaded
Open this post in threaded view
|

Re: ReadingOnlyVariableBindings

Nicolas Cellier
See the method

isSpecialWriteBinding
        "Return true if this variable binding is write protected, e.g.,
should not be accessed primitively but rather by sending #value:
messages"
        ^true

And its senders.
That means that a different byte code must be generated in order to
send #value rather than accessing the 2nd inst. var. directly.

Nicolas

2013/3/8 Colin Putney <[hidden email]>:

> Hi everyone,
>
> One oddity I discovered while working on Environments is that, when a
> binding is converted to read-only or read-write, all the methods that refer
> to that binding are recompiled.
>
> Does anybody know why this is done?
>
> Colin
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: ReadingOnlyVariableBindings

Colin Putney-3



On Fri, Mar 8, 2013 at 12:42 PM, Nicolas Cellier <[hidden email]> wrote:
See the method

isSpecialWriteBinding
        "Return true if this variable binding is write protected, e.g.,
should not be accessed primitively but rather by sending #value:
messages"
        ^true

And its senders.
That means that a different byte code must be generated in order to
send #value rather than accessing the 2nd inst. var. directly.

Nicolas

Aahh, that makes sense. Thanks.

Colin 


Reply | Threaded
Open this post in threaded view
|

Re: ReadingOnlyVariableBindings

Nicolas Cellier
2013/3/8 Colin Putney <[hidden email]>:

>
>
>
> On Fri, Mar 8, 2013 at 12:42 PM, Nicolas Cellier
> <[hidden email]> wrote:
>>
>> See the method
>>
>> isSpecialWriteBinding
>>         "Return true if this variable binding is write protected, e.g.,
>> should not be accessed primitively but rather by sending #value:
>> messages"
>>         ^true
>>
>> And its senders.
>> That means that a different byte code must be generated in order to
>> send #value rather than accessing the 2nd inst. var. directly.
>>
>> Nicolas
>
>
> Aahh, that makes sense. Thanks.
>
> Colin
>

More precisely
isSpecialReadBinding triggers read access thru #value
isSpecialWriteBinding  triggers write access thru #value:
But I think you understood me :)

Nicolas

>
>

Reply | Threaded
Open this post in threaded view
|

Re: ReadingOnlyVariableBindings

Colin Putney-3



On Fri, Mar 8, 2013 at 12:49 PM, Nicolas Cellier <[hidden email]> wrote:
 
More precisely
isSpecialReadBinding triggers read access thru #value
isSpecialWriteBinding  triggers write access thru #value:
But I think you understood me :)

Yup, this is just what I was looking for.

Colin