I think that
mixed x = foo(); if(zero_type(x)) { werror("No value\n"); } else { werror("The value is %O\n", x); }
is much better than
mixed x; mixed y = catch(x = foo()); if(!y) { werror("The value is %O\n", x); } else if(!arrayp(y) && !(objectp(y) && y->is_generic_error)) { werror("No value\n"); } else { throw(y); }
though.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-01-23 16:47: Subject: Re: zero_type() & UNDEFINED and _typeof()
Well, I think too that UNDEFINED is basically ugly, much on the same ground. The ugliness gets worse since it's inconsistent. I'd like a solution where there was no need for such a value at all, but so far noone has come up with an alternative that is good enough.
/ Martin Stjernholm, Roxen IS