Perhaps naive question about the colon.

Frank Shearar Frank.Shearar at rnid.org.uk
Thu Dec 2 12:42:07 UTC 2004


Blake <blake at kingdomrpg.com> wrote:
> 
> On Thu, 02 Dec 2004 19:05:01 +0800, Yar Hwee Boon 
> <hboon at motionobj.com>  
> wrote:
> 
> >> caveman light fire with flintAndTinder usingForFuel twigsAndStraw.
> >
> > Well.. at the very least, "caveman light fire with flintAndTinder  
> > usingForFuel twigsAndStraw" is already valid syntax now, 
> its a chain of  
> > simple message sends, no?
> 
> Aha! It was a naive question.<s>
> 
> Thanks for bearing with me. I've never gotten used to that 
> construct. Very  
> often in the code it's done with line-breaks, and I think I 
> had attributed  
> significance to those.

You mean something like

caveman
    light: fire
    with: flintAndTinder
    usingForFuel: twigsAndStraw

?

I don't know when it was invented, but Kent Beck's (fantastic!) "Smalltalk Best Practice Pattern" describes it in the Indented Control Flow pattern on page 175.

I've always figured it as analogous to doing this in Delphi:

Caveman.Light(Fire,
              FlintAndTinder,
              TwigsAndStraw);

at least where indenting's concerned.

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
********************************************************************




More information about the Squeak-dev mailing list