[squeak-dev] Horribly mutable compiled method litterals

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Nov 8 15:44:35 UTC 2016


2016-11-08 16:03 GMT+01:00 St├ęphane Rollandin <lecteur at zogotounga.net>:

> Hello,
>
> I just realized that one can change much too easily the behavior of some
> compiled methods dynamically, which seems to me more like a bug than a
> feature.
>
> For example, if you do the following in a workspace:
>
> Character constantNames at: 5 put: #hello
>
> then until #constantNames is recompiled, it will return #(#backspace #cr
> #delete #escape #hello #null #newPage #space #tab) instead of #(#backspace
> #cr #delete #escape #lf #null #newPage #space #tab).
>
> This allows horrible bugs horribly difficult to debug which is, IMHO,
> horrible.
>
> So, is it a feature ?
>
>
> Stef
>
>
>
It may have been used as a hack for providing static storage with scope
restricted to a method, but it's clearly not an official feature.

We will have immutaiblity in a very near future (or should I say we have?),
so we might forbid this very soon now...

But anyway, what do you expect from a language that provides a #become:
operation ?
We need to teach that superpowers implies super-responsibility.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20161108/47573060/attachment.html>


More information about the Squeak-dev mailing list