[Newbies] concatenation of non-Collections
Bert Freudenberg
bert at freudenbergs.de
Sun Nov 2 23:25:11 UTC 2008
Am 02.11.2008 um 12:34 schrieb Mark Volkmann <mark at ociweb.com>:
> Wouldn't it be convenient if you could do this:
>
> msg := 'The number is ', number
>
> instead of
>
> msg := 'The number is ', number printString
>
> Or even this:
>
> msg := number, ' is the value you entered.'
>
> instead of
>
> msg := number printString, ' is the value you entered.'
>
> This would require the comma method in Collection to act differently
> when the argument isn't a Collection
> and the Number class would need to add a comma method.
It's convenient indeed but could lead to surprises for non-string
collections. Also, there is a school of thinking that abhors any
"magic". It does change the semantics of #, depending on the passed
object, so there is some reason nor to do it.
I personally find it useful, and IIRC Croquet implements String>>, as
"^super , anObject asString."
- Bert -
More information about the Beginners
mailing list