<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>
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. :)<br><br>> Date: Thu, 26 Jul 2007 20:06:32 +0100<br>> From: keith_hodges@yahoo.co.uk<br>> To: squeak-dev@lists.squeakfoundation.org<br>> Subject: Re: Message Eating Null - article<br>> <br>> <br>> ><br>> ><br>> > Yuck, I wouldn't do either of those. I would do:<br>> ><br>> > widget setStringValue: #(office phone lastNumberDialed asString) <br>> > inject: person into: [:obj :sel| o == nil ifTrue: [ nil ] ifFalse: [ <br>> > obj sel ] ]<br>> ><br>> > ------------------------------------------------------------------------<br>> you would?<br>> <br>> To me the above looks as close to perl as smalltalk is hopefully ever <br>> likely to get!<br>> <br>> ;-)<br>> <br>> Keith<br>> <br>> p.s. Someone once accused me of being a PL/1 programmer in a former life.<br>> <br>> <br><br /><hr />See what you’re getting into…before you go there. <a href='http://newlivehotmail.com' target='_new'>Check it out!</a></body>
</html>