<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><br><hr id="stopSpelling">> Date: Thu, 26 Jul 2007 13:14:52 -0700<br>> From: tapplek@gmail.com<br>> To: squeak-dev@lists.squeakfoundation.org<br>> Subject: Re: Message Eating Null - article<br>> <br>> > What on earth are you talking about????? That is #inject:into:, known in<br>> > functional programming as a fold. <br>> <br>> I agree; that is a seriously obfuscated way to access the last<br>> number dialed. I don't know how often 4-level chaining would<br>> arise in practice, but I would hope it would be as simple as:<br>> <br>> ^ self office phone lastNumberDialed asString<br>> <br>> Anything more complex is not lazy enough to get diligently<br>> applied everywhere it should<br><br>Yes, but it isn't quite that simple. Normally I would do exactly what you suggested. But in that case I would want a debugger if any of those messages returned nil. If you want different handling for nil then the default you have to do a test after each message send. This can either be done by making a special object as Keith suggested, using a fold as I suggested or brute forcing your way through as in Keith's example of what not to do. :)<br><br /><hr />Don't get caught with egg on your face. <a href='http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink' target='_new'>Play Chicktionary! </a></body>
</html>