[Vm-dev] Questions related to immutability in Cog
btc at openinworld.com
Tue Nov 17 22:59:03 UTC 2015
On Wed, Nov 18, 2015 at 1:42 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> Hi Ben,
> On Mon, Nov 16, 2015 at 3:05 PM, Ben Coman <btc at openinworld.com> wrote:
>> On Tue, Nov 17, 2015 at 1:05 AM, Clément Bera <bera.clement at gmail.com> wrote:
>> > Hi all,
>> > I am willing to have this done because I need it for the sista production version (I need the literals not to be able to be become).
>> > So my questions are:
>> > - Is Sebastian or someone going to do this ? Else I will try to find a student for next summer or do it myself.
>> > - We agreed that what we build is a write barrier and not immutability. Hence, how should I call the methods marking the object as non writable ? #markAsNonWritable, #markAsWritable, #isWritable ? The call back selector for instance variables will remain #attemptToWrite: value atIndex: index.
>> Why not be explicit... #markWriteBarrier, #clearWriteBarrier ?
>> Could still have #isWritable, or maybe #hasWriteBarrier or some variation ?
> Yuck. I could live with beReadOnly, beWriteable, isReadOnly. But hasWriteBarrier or some such, no. Personally I like isImmutable, beImmutable, but if folks want to reserve that for a deeper concept then fine. BTW, for compatibility with VisualWorks I'd like the exception raised when an attempt is made to write to a read-only object to be called NoModificationError.
Cool. I'm just tossing ideas from the peanut gallery.
More information about the Vm-dev