[squeak-dev] Re: Preference Pragmas in instance methods?

Andreas Raab andreas.raab at gmx.de
Mon Mar 8 03:12:35 UTC 2010


On 3/7/2010 5:04 PM, Chris Muller wrote:
>> What an instance side preference would mean ?
>> A different preference for every instance ?
>
> There is only one instance of SystemNavigation.
>
>> My opinion is that they belong to class only.
>
> I suppose I could add the first class-var to SystemNavigation.

You don't have to. You can delegate the class-side method to the 
singleton instance, i.e.,

SystemNavigation>>traceMessages
	"Accessor for preference"
	<preference: ....>
	^self default traceMessages

etc. This requires the methods on the class but not the state.

Cheers,
   - Andreas

> However, SystemNavigation is a Singleton _instance_ which is where its
> other state and API are.  So we would have this lone #traceMessages
> option on the SystemNavigation class-side just so we could use a
> pragma.  It creates a dichotomy about which SystemNavigation is
> supposed to be used.  Since you were only suggesting anyway, the
> easiest thing for now would probably be to just leave it in
> Preferences.
>
>   - Chris
>
>




More information about the Squeak-dev mailing list