[Pharo-dev] Is variable shadowing a feature or a bug?

Eliot Miranda eliot.miranda at gmail.com
Thu Dec 12 14:04:30 EST 2013


On Thu, Dec 12, 2013 at 7:03 AM, Marcus Denker <marcus.denker at inria.fr>wrote:

>
> On 12 Dec 2013, at 15:44, Benjamin <benjamin.vanryseghem.pharo at gmail.com>
> wrote:
>
> > I just discovered that in Pharo 3 you can do:
> >
> > [ :bool |
> >       self logCr: bool.
> >       bool := false.
> >       self logCr: bool.
> >       ] value: true
> >
> > Is this a bug or a feature ?
>
> https://pharo.fogbugz.com/f/cases/12419/block-arguments-should-be-read-only


except that it didn't used to be a bug pre closures, so *if* its important
to be able to load old code this should be made a preference which is by
default on.  i.e. by default assigning to any argument is an error, but the
preference can be set to allow assignments to block args.  At least IIRC
that's how it is in Squeak right now.
-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131212/ed2fae0b/attachment-0002.html>


More information about the Pharo-dev mailing list