> Christian Schmitz wrote:
>
> Why would you need that? If a constructor wants to fail, it could
> just raise an exception, and the caller can catch it.
I don't like that much exceptions.
Returning nil should be a normal thing and not an exception.
> I used TP 3 and later version, but I can't remember "FAIL". What did
> it do better than the exception raising approach?
it's from TP5 or 6.
You may know TP's exit command which is like RB's return.
Fail is just a special return used inside constructors to tell TP to
destroy the object and return nil.
Mfg
Christian
--
Besuchen Sie mich auf der Cebit!
Vom 13. bis zum 20. März 2002 auf dem Stand A15 in Halle 11.
http://www.christians-software.de
|