[squeak-dev] The Inbox: Kernel-fbs.695.mcz

Chris Muller asqueaker at gmail.com
Fri Jun 8 19:18:20 UTC 2012


> FWIW, I'd call #() canonical, whereas "Array empty" is decidedly not part of the Smalltalk
> canon.

Well, there are already six #empty constructors in the image,
"decided" by four prominent authors dating back to 2004.  And that's
just the implementors, there are many more authors who decided to SEND
the #empty message even though they didn't need to.

I don't see how type-specific symbology could be less "cluttered" than
a couple of English words, but I don't want argue about taste.  More
important is the developing consistency among of class-side API's -- I
have #empty in some in my own apps and the six in the image proves
there are a variety of different kinds of objects that make sense to
have an "empty" instance.  A consistent API also provides polymorphic
opportunities.

I see nothing wrong #empty in fact I think its more
intention-revealing, consistent and opportunistic.





On Fri, Jun 8, 2012 at 6:42 AM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> On 08.06.2012, at 13:00, Frank Shearar <frank.shearar at gmail.com> wrote:
>
>> On 8 June 2012 08:57, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
>>>> * Use the canonical Array empty rather than #();
>>>
>>>
>>> What's wrong with #() ?
>>
>> Nothing hugely. I made the change because I remembered Chris Muller's
>> earlier statement about using a canonical instance. I like canonical
>> instances.
>
> If we think a canonical instance is preferable, then we should change the compiler. IMHO, "Array new" adds unnecessary clutter over "#()".
>
>
> - Bert -
>
>


More information about the Squeak-dev mailing list