Message Eating Null - article

J J azreal1977 at hotmail.com
Thu Jul 26 19:25:22 UTC 2007


oh, and I forgot that I actually needed:    obj perform: selFrom: azreal1977 at hotmail.comTo: squeak-dev at lists.squeakfoundation.orgDate: Thu, 26 Jul 2007 19:23:42 +0000Subject: RE: Message Eating Null - article






What on earth are you talking about?????  That is #inject:into:, known in functional programming as a fold.  Perl doesn't even have a fold operator.  The only part that looks bad is the block, and only because I don't know what #ifNotNil: returns if the block isn't nil.  Plus with this I have the option of doing a home return when I first encounter the nil, while your Null will have to keep chomping until the end. :)> Date: Thu, 26 Jul 2007 20:06:32 +0100> From: keith_hodges at yahoo.co.uk> To: squeak-dev at lists.squeakfoundation.org> Subject: Re: Message Eating Null - article> >  > >> >> > Yuck, I wouldn't do either of those.  I would do:> >> > widget setStringValue: #(office phone lastNumberDialed asString) > > inject: person into: [:obj :sel| o == nil ifTrue: [ nil ] ifFalse: [ > > obj sel ] ]> >> > ------------------------------------------------------------------------> you would?> > To me the above looks as close to perl as smalltalk is hopefully ever > likely to get!> > ;-)> > Keith> > p.s. Someone once accused me of being a PL/1 programmer in a former life.> > See what you’re getting into…before you go there. Check it out!

_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best web mail—award-winning Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HMWL_mini_pcmag_0707
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070726/df56683b/attachment.htm


More information about the Squeak-dev mailing list