[squeak-dev] Curly Braces history (was Re: A comparative article)

Bert Freudenberg bert at freudenbergs.de
Thu May 10 14:31:58 UTC 2012


On 10.05.2012, at 15:12, H. Hirzel wrote:

> Thanks for the link Bert,
> 
> <citation>
> David N. Smith wrote:
> Curly braces are currently used in Squeak to construct
> runtime-evaluated collections
> </citation>.
> 
> The question is -- is there some more documentation than just some
> clippings from an email correspondence.
> 
> If I understand you correctly people 'forgot' to take them out and so
> this syntax stayed.

No, that was only true in 1997. After that it has been embraced (pun intended) more widely.

> Is it used much?

In my working image there are 111 senders of braceArray. A vanilla image has over 50. So yes, it is used quite a bit.

> Would it be possible to deprecate this usage and
> 
> reuse the syntax for  implementing literal dictionaries 'JSON style'?


I see no reason for trying to partly mimic JSON in Squeak.

For one, you can always use

	{#foo -> 1. #bar -> 42} as: Dictionary.

Secondly, if this is too slow, the canonical way is to put the dictionary in a class variable.

Thirdly, I'm pretty sure literal dictionaries have less use than both literal arrays and brace arrays. 

I wouldn't be violently opposed to adding a new syntax for literal arrays, but I don't really see the need, and it would have to be a new syntax that does not clash with the current one.

- Bert -



More information about the Squeak-dev mailing list