[Glass] Attempt to modify invariant object, anArray

Paul Baumann via Glass glass at lists.gemtalksystems.com
Fri Jun 3 17:40:29 PDT 2016


aRow is an array that was created as part of a compiled method. The error
is preventing you from changing code by changing the literal array. You may
want to #collect: copies of each row that are then modified. Then again the
code seems to serve no purpose except perhaps if intended for data read
from an external source; with real externally sourced data the error would
not happen.

Paul Baumann
On Jun 3, 2016 8:09 PM, "Mariano Martinez Peck via Glass" <
glass at lists.gemtalksystems.com> wrote:

> Thank you guys..I was indeed making some default instances with this
> literal arrays..and this was the first time I have to edit those..
>
> Thanks!
>
> On Fri, Jun 3, 2016 at 8:46 PM, Richard Sargent <
> richard.sargent at gemtalksystems.com> wrote:
>
>> On Fri, Jun 3, 2016 at 1:30 PM, Mariano Martinez Peck via Glass <
>> glass at lists.gemtalksystems.com> wrote:
>>
>>> Hi guys,
>>>
>>> Quick email as I must leave now... I am trying to run this code:
>>>
>>> tableSpec table do: [ :aRow |
>>> | value |
>>> value := (aRow at: 2) = 'L' ifTrue: [ 'Left' ] ifFalse: [ 'Right' ].
>>>         aRow at: index put: value
>>> ].
>>>
>>> the 'aRow' array is as simple as anArray ('Price' , 'R', '', '') ...
>>> Looks like a problem of passing the array as argument...
>>>
>>> The error I get is:
>>>
>>> " ArgumentTypeError(AbstractException)>>_signalFromPrimitive: @5 line
>>> 15a ArgumentTypeError occurred (error 2031), reason:markWritten.b, Attempt
>>> to modify invariant object, anArray
>>>
>>> I just don't get it.. grrr must run now..
>>>
>>
>> Hi Mariano,
>>
>> Given what you have described, the most likely cause is passing in a
>> literal array. That guess is further reinforced by using the name
>> "tableSpec".
>> e.g.
>> #(
>> ('Price', 'R', '', '')
>> ('Quantity', 'R', '', '')
>> ('Cost', 'R', '', '')
>> )
>>
>> -- Richard
>>
>>
>>> Cheers,
>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>> _______________________________________________
>>> Glass mailing list
>>> Glass at lists.gemtalksystems.com
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>>
>>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20160603/11acf9e2/attachment.html>


More information about the Glass mailing list