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!)
Previous text:
2003-01-23 00:58: Subject: Re: zero_type() & UNDEFINED and _typeof()
With that operator there would be two different functions and no need for a special value. But anyway, it wouldn't be wise to remove the value for the reason in 9629831. Not to mention functions like resolv() etc.
Adding an existence operation could still be useful though, since it'd give a standardized way for a collection class to implement a check for existence without at the same time calculating the value.
/ Martin Stjernholm, Roxen IS