it is an interesting topic. I find #() more expressive than Array empty. but perhaps this is because I have learnt to recognize it deeply. Something i remember Michele Lanza talking about visualisation and the types of things (size, colour, shape) that we have a primitive recognition of http://www.se-radio.net/podcast/2009-03/episode-130-code-visualization-miche... and I am sure all the Moose folks are very familiar... I am not sure if it applies in this case or not of course... Anyway I feel that I never have to 'parse' #() but when I see Array empty, i have to read it in my head. So for me it might be more expressive but it is more verbose. I am just interested in the debate from a syntax point of view, not an optimization point of view. I feel there is a correlation between #() being physically small, about 5-10mm say on the screen with Array new, or String new which is at least 5cm with a space that breaks it up. Do you see my point? I guess I don't understand why without it, Pharo does not describe itself. You would only expect a single send of Array empty in the system (from the optimzation machinery)? If people started using it generally, i would find that a shame for the reason described above that it is not compact. If all you want is the empty array defined in a single place, I guess that is fine. but then how do you mark it private? cheers, Mike On Tue, Feb 16, 2010 at 8:57 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
On Feb 16, 2010, at 8:01 PM, Chris Muller wrote:
Even if you make the compiler change, I hope you will still consider leaving the two #empty methods in place for expressiveness. Â They, too, would answer the single canonicalized global stored in the compiler. Â However, the use of #empty makes the canonicalization explicit rather than implicit, and affords appreciation of a Pharo system that describes itself, e.g., associating the word "empty" with the notation that a new Pharo user might find cryptic.
this changes was already integrated.
Now your argument could work if the syntax #(a b c) would disappear. Now since you have to teach/learn #(a b c), it should be clear that #() is an empty array. The same argument holds for '' versus String empty. So I do not see the real gain.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project