No, I'm no longer suggesting that if you read the text you commented more carefully. But thanks anyway for a more verbose description of the drawbacks than I gave.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-01-23 01:23: Subject: Re: zero_type() & UNDEFINED and _typeof()
Eh? "There would be"? The code would hardly rewrite itself. Let's say I have a large function called "do_heavy_database_query()" which can return a value, or UNDEFINED if the database doesn't know the answer. Are you suggesting I should duplicate the code and create two functions "do_heavy_database_query_ok()" and "do_heavy_database_query_value()", and then call first the first one to check if the database knows the answer and then the second one to actually get the value? Besides the fact that the database operation would have to be done twice, there is also the problem of atomicity. The database might forget the value between the call to "do_heavy_database_query_ok()" and "do_heavy_database_query_value()".
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)