[squeak-dev] The Trunk: MorphicExtras-cmm.201.mcz

Bert Freudenberg bert at freudenbergs.de
Wed Dec 14 18:13:13 UTC 2016

On Tue, Dec 13, 2016 at 11:52 AM, Chris Muller <asqueaker at gmail.com> wrote:

> > Instead of checking for "understands" we should use valueOfFlag: (which
> > defaults to false) to get back the old behavior.
> Hmm, I'm not sure "false" makes sense as a universal default value.

False is the default for valueOfFlag:. It is nil for valueOfPreference:.

> Apps typically choose their own lazy-initialized values
> attribute-by-attribute, and usually based on it having been nil.

We're talking about old-style preferences which IMHO used to be a very
convenient, succinct, and highly readable. We just wrote "Preferences
myFlag ifTrue: [...]" and this would universally work *without any other
support code*. This was really nice for live experimenting, you just throw
this expression in somewhere without having to worry about breaking

> Or we recreate the
> > preference.
> Sure.
> > Or we make it into a "pragma" preference on some class (which
> > seems to be the preferred way nowadays, even though it leads to an
> explosion
> > of pref accessor methods?)
> *Thank you* for leveling a fair critique at pragma preferences.  IMO,
> they are preventing the emergence of simple and powerful abstractions
> in our Preferences framework while, as you alluded, making lots of
> code.  :(  Their real benefits deserve some scrutiny.
> > What would be best?
> This.
>    http://lists.squeakfoundation.org/pipermail/squeak-dev/2016-
> March/188486.html
Agreed, but it doesn't really answer my question of what to write instead
of "(Preferences understands: #foo) and: [Preferences foo]".

- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20161214/73d13622/attachment.html>

More information about the Squeak-dev mailing list