[squeak-dev] Environments: Import order

Bert Freudenberg bert at freudenbergs.de
Fri Dec 20 21:56:31 UTC 2013


If both Griffle and Plonk provide Feep, I expect to get Plonk's Feep, not Griffle's, or worse, a Feep that was defined even before Griffle or Plonk. So to me the order makes sense.

Importing is very different from a search path, which indeed would be resolved the other way around.

- Bert -

On 20.12.2013, at 22:49, Chris Muller <asqueaker at gmail.com> wrote:

> Plus, the way the API is used
> 
> myEnvironment
>    import: #Griffle ;
>    import: #Plonk
> 
> looks more like a chain-of-responsibility list..  Not that Plonk
> "wraps" Griffle..
> 
> On Fri, Dec 20, 2013 at 3:35 PM, Chris Muller <asqueaker at gmail.com> wrote:
>> Well, it's backward from how name-resolutions works in other languages
>> like Java, isn't it?
>> 
>> On Fri, Dec 20, 2013 at 3:03 PM, Frank Shearar <frank.shearar at gmail.com> wrote:
>>> On 20 December 2013 20:40, Chris Muller <asqueaker at gmail.com> wrote:
>>>> One thing I just noticed is that the #import... methods on Environment
>>>> seem to chain the imports in order they are added.  This means the
>>>> last-added is first-searched when resolving names.
>>>> 
>>>> Seems like first import should be first-searched...?
>>> 
>>> I think the behaviour's the correct one: adding imports is like
>>> wrapping a present in layers of paper: the last added layer/import is
>>> the outermost layer.
>>> 
>>> frank
>>> 
> 



More information about the Squeak-dev mailing list