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 |
Use
String new rather than ''
|
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 _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
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:
Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Free forum by Nabble | Edit this page |