Simple String Question.

Cees de Groot cg at cdegroot.com
Thu May 16 18:29:11 UTC 2002


Richard A. O'Keefe <ok at cs.otago.ac.nz> said:
>Here it is in WriteStream:
>
Thanks, although I meant it more as a hack for Jimmie to put his teeth in :-)

>This is "cute", but not really a good idea.  We _have_ a standard name
>for the operation "add all these things to this stream" and it's #nextPutAll:
>not #, .  Using #, instead would just be confusing.
>
It probably gets interesting when you implement the comma operator on
WriteStream using double-dispatch so this works:

    (WriteStream , 'foo', $:, 1.23) contents.

(came up on c.l.s. a while ago, and I think it's not such a bad idea. If
#, is bad, you can always use #<< and attract some C++ programmers from
the dark side). IMVHO, that'd be useful syntactic sugar (that, or printf() -
one of the things I like less about the Smalltalk envs I know is that it is so
verbose to generate a string from little bits and pieces).

-- 
Cees de Groot               http://www.cdegroot.com     <cg at cdegroot.com>
GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B



More information about the Squeak-dev mailing list