links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Dan private answer
Last updated at 2:39 pm UTC on 16 January 2006
>see my other email with andreas. I was certainly wrong in the phrasing but I
>have the impression that constructs are really needed for things (in the
>context of simplicity purity) that do not have equivalent. And I found that
>the criteria of object creation is interesting.
>for example Character with: 'a' is not equivalent to $a
>because the first one is always created while the other one is created only
>the first time the method is compiled at least in VW.
>With this criteria in mind (which is rather compiler oriented but still
>reality) #() and Array new are more equivalent
>For {} and Array new there is no difference. so {} is pure syntax sugar.
>What is your point of view on that?

There are many parts of it for me. You can CC this to the list if you want to continue an open discussion...

1. I really dislike the form that I have seen in , eg, storeOn:
(Array new: N)
at: 1 put: expr;
at: 2 put: expr2;
...) yourself

2. Yours is prettier, but slower because of the copy at the end,
(and doubly slow because of add: instead of addLast:)

3. You'll see that by making it a pattern, we generate very good code,
with special cases for N = 4.

4. Mainly, though, I just like "seeing" and array, not a sequential statement.

5. FYI, the history was that Larry Tesler put this into Apple ST back in 1982 or 82, I think. No on really used it much (Apple ST or braces ;-). I think he did it as much to answer requests for a case statement as anything else. Then he did the structure assignment to which A.G. referred. I thought this was really confusing, so I took that much out. But I still liked the braces otherwise for the reasons above.

6. The purist in me knows we don't need braces (hey, I wrote the original syntax ;-). The pragmatist enjoys the convenience now. As everyone else says, it's like x @ y (meaning it's an iconic form, and a nice convenience).

7. There's also an issue of people wanting true false and nil to be compiled as values rather than names in the #() arrays. I have always considered that to be a hack. Braces provide an alternative answer for that "need" as well.