[squeak-dev] Preferences and Environments

Frank Shearar frank.shearar at gmail.com
Thu Jan 9 18:06:11 UTC 2014


On 9 January 2014 16:38, Colin Putney <colin at wiresong.com> wrote:
>
>
>
> On Thu, Jan 9, 2014 at 3:20 AM, Frank Shearar <frank.shearar at gmail.com>
> wrote:
>
>>
>> My first thought is that it lets people using the wrong (*) token for
>> assignment - $_ - to change Scanner's preference within their
>> Environment, while the base/"top" Environment uses the correct token -
>> :=. Ditto for things that require allowing $_ in selectors, like
>> Xtreams.
>
>
> Oooh. That's pretty sweet, alright.
>
> However, the way things are currently implemented, it's tricky to actually
> do that. We'd have to have another copy of Compiler and  Scanner loaded into
> one environment, import it into the Xtreams environment and then override
> #compilerClass to return the imported Compiler in all the classes that get
> compiled there. Yuck.
>
> Ugh. It looks like Pragma preferences and Environments don't mix well.

That's true, for the moment. I'd like to at some point experiment with
having imports _import an anonymous subclass_ of something. In that
case, you'd end up with Xtreams having its own Compiler class, and the
problem would go away.

(I want to try this to see if I can make Environment-local extension methods.)

frank


More information about the Squeak-dev mailing list