[Glass] write stream problem with quotes

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

[Glass] write stream problem with quotes

Mariano Martinez Peck
Hi guys,

I am trying to write a stream and this simply fails:

'' writeStream nextPutAll: ' '' '

with a 

a ArgumentTypeError occurred (error 2031), reason:markWritten.a, Attempt to modify invariant object, 

Any idea?

thanks

--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] write stream problem with quotes

Paul DeBruicker
Use

String new

rather than


''







Mariano Martinez Peck wrote
Hi guys,

I am trying to write a stream and this simply fails:

'' writeStream nextPutAll: ' '' '

with a

a ArgumentTypeError occurred (error 2031), reason:markWritten.a, Attempt to
modify invariant object,

Any idea?

thanks

--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] write stream problem with quotes

Dale Henrichs-3
Paul is correct ... the literal strings are invariant, so you can't accidentally or on purpose change the semantics of a compiled method by fiddling with a String literal ...

You can create your own invariant objects if you want to (invariant objects are useful in some contexts) by sending the #immediateInvariant and test using #isInvairant ... 

Dale


On Fri, Feb 14, 2014 at 4:25 PM, Paul DeBruicker <[hidden email]> wrote:
Use

String new

rather than


''








Mariano Martinez Peck wrote
> Hi guys,
>
> I am trying to write a stream and this simply fails:
>
> '' writeStream nextPutAll: ' '' '
>
> with a
>
> a ArgumentTypeError occurred (error 2031), reason:markWritten.a, Attempt
> to
> modify invariant object,
>
> Any idea?
>
> thanks
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
> _______________________________________________
> Glass mailing list

> Glass@.gemtalksystems

> http://lists.gemtalksystems.com/mailman/listinfo/glass





--
View this message in context: http://forum.world.st/Glass-write-stream-problem-with-quotes-tp4743914p4743916.html
Sent from the GLASS mailing list archive at Nabble.com.
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] write stream problem with quotes

Mariano Martinez Peck
Thanks guys. I was some days off and I didn't have the time to really analyze the problem. You just fixed it in a couple of minutes! Thanks a lot.

Indeed, it makes total sense. I remember we were discussing that in Pharo some months ago...because so far in Pharo literals are mutable ;)


On Fri, Feb 14, 2014 at 9:30 PM, Dale Henrichs <[hidden email]> wrote:
Paul is correct ... the literal strings are invariant, so you can't accidentally or on purpose change the semantics of a compiled method by fiddling with a String literal ...

You can create your own invariant objects if you want to (invariant objects are useful in some contexts) by sending the #immediateInvariant and test using #isInvairant ... 

Dale


On Fri, Feb 14, 2014 at 4:25 PM, Paul DeBruicker <[hidden email]> wrote:
Use

String new

rather than


''








Mariano Martinez Peck wrote
> Hi guys,
>
> I am trying to write a stream and this simply fails:
>
> '' writeStream nextPutAll: ' '' '
>
> with a
>
> a ArgumentTypeError occurred (error 2031), reason:markWritten.a, Attempt
> to
> modify invariant object,
>
> Any idea?
>
> thanks
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
> _______________________________________________
> Glass mailing list

> Glass@.gemtalksystems

> http://lists.gemtalksystems.com/mailman/listinfo/glass





--
View this message in context: http://forum.world.st/Glass-write-stream-problem-with-quotes-tp4743914p4743916.html
Sent from the GLASS mailing list archive at Nabble.com.
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass




--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass