Em 06/01/2010 22:06, Levente Uzonyi < leves@elte.hu > escreveu:
On Wed, 6 Jan 2010, csrabak@bol.com.br wrote:
Em 06/01/2010 17:30, Levente Uzonyi < leves@elte.hu > escreveu:
On Wed, 6 Jan 2010, csrabak@bol.com.br wrote: [snipped]
As everybody else knows :-P the string concatenation operator is '+', right!? So #, needs to be explained anyway. . . You're wrong, it's '.'. :) You know this polyglot approach to programming ends up with some confusion :-) [snipped]
This may lead to the same problem we already have with #, namely it is slow and not recommended for repeated operations. No, it's fast, because it doesn't create copies. Of course to know that you also have to know that List is an alias for OrderedCollection... It's just a C++ism that makes your code slower. :) Levente, In a ordinary (sort of, it's a dev image, Pharo 1.0 #10503, there is no List class, and:
Collection>>, aCollection ^self copy addAll: aCollection; yourself Which creates copies for each #, method send, right? Or do I miss something here? Yes you do, List is one of Adrian's ideas to Huffman code smalltalk. Details here http://www.iam.unibe.ch/~akuhn/blog/2009/one-letter-method-names/
Ok Levente! In this case after reading Adrian's blog post, I would say "List" is not a good choice: VW uses List for a different kind of object (a descendant from OrderedCollection, in fact). As a side note, IMNHO Object>>out (as Travis' idea) seems to me better than Object>>p for the same purpose. Regards, -- Cesar Rabak