Way of indicating an error
Damien Cassou
damien.cassou at gmail.com
Mon Feb 26 16:54:53 UTC 2007
> But consider also how those same languages handle the problem of "item
> not found", whether it's not finding a substring in a larger string,
> an object in a collection, or a web resource. Nearly always, the
> programmer expects to check for the possibility that the item wasn't
> found, and so it's natural in those cases to return nil (or whatever)
> to say so. Only a few raise an exception when something isn't found.
> Smalltalk's common way of having an #...ifNotFound: block is another
> kind of exception handling.
What would you expect from iterating over #(1 nil 2) ? The second
#next will return nil. But it does not indicate the end of stream.
--
Damien Cassou
More information about the Squeak-dev
mailing list
|