Blake blake@kingdomrpg.com wrote:
On Thu, 02 Dec 2004 12:59:04 +0100, Andreas Nilsson wahboh@mac.com wrote:
I'd say there's a difference between: caveman light: fire with: flintAndTinder usingForFuel: twigsAndStraw
and: caveman light fire with flintAndTinder usingForFuel twigsAndStraw
The first example is calling a method with arguments to
tell it what to
do while the second simply calls the methods twigsAndStraw, usingForFuel, flintAndTinder, with, fire and light on the
caveman object.
You could, I suppose, write classes that has methods instead of arguments and rely on people calling them in the right order but I wouldn't recommend it.
The second example could also be used like this: caveman flindAndTinder twigsAndStraw usingForFuel with fire light
Well, as I said, it was a conceptual (perceptual? habitual?) issue. I don't think of terms in consecutive statements--a hold over from more procedural langugaes, so I'd "intuit" a special punctuation for multiple sends. In other words, in Smalltalk, you'd send three messages with one parm each as:
Caveman find: flint gather: twigs light:fire.
This actually sends the message #find:gather:light. If you mean to send #find: then #gather: then #light: you need disambiguate using brackets:
((Caveman find: flint) gather: twigs) light: fire
(I'm ignoring semantics here - you probably don't want to send the #gather: message to the result of #find: as I do in this example!)
whereas, I would expect punctuation for the separation versus for the parameters:
Caveman find flint, gather twigs, light fire. "Three messages, one parm each."
Ah, a cascade:
Caveman find: flint; gather: twigs; light: fire.
which is a neater way of saying
Caveman find: flint. Caveman gather: twigs. Caveman light: fire.
frank
******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent RNID policy. If you are not the intended recipient you are advised that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. If you have received this email in error please notify the RNID Helpdesk by telephone on: +44 (0) 207 296 8282. The Royal National Institute for Deaf People Registered Office 19*23 Featherstone Street London EC1Y 8SL No. 454169 (England) Registered Charity No. 207720 ********************************************************************
On Thu, 2 Dec 2004 12:47:18 -0000, Frank Shearar Frank.Shearar@rnid.org.uk wrote:
Caveman find: flint gather: twigs light:fire.
This actually sends the message #find:gather:light. If you mean to send #find: then #gather: then #light: you need disambiguate using brackets:
Doh! Right. See, you can tell I haven't used them much lately. I'm the same way with C. I'll start out writing
C = C + 1; D = C + 1;
then:
C++; D = C;
then
D = C++; //or is it D = ++C; ?
I always fall back on plain code but get more comfortable with the idioms for better (Smalltalk) or worse (C)<s>.
Caveman find: flint; gather: twigs; light: fire.
That's the one. That looks right, even.<s>
which is a neater way of saying
Caveman find: flint. Caveman gather: twigs. Caveman light: fire.
Exactly. or, in Object Pascal,
with Caveman do begin Find(Flint); Gather(Twigs); Light(Fire); end;
OK, good, I get the Smalltalk syntax now and like it.<s>
squeak-dev@lists.squeakfoundation.org