object(x) rethink

new topic     » topic index » view thread      » older message » newer message

The Euphoria docs tell me that object(x) always returns True.  That makes it a
bit useless. Especially since if x is NOT an object it crashes Euphoria!

Would it not be better if object(x) returned True if x was an object and False
if x either was not an object (i.e. something else like a function) or, and
this is what I would like, if x had not yet been assigned a value so, even
though
it might have been declared, it is valueless.

This should be very easy to implement - just return False rather than crashing!

It would be useful for modules which can then detect a first call and initiate
variables, without needing an explicit initialisation call or putting the
assignments in where the variables are declared.

So what do you worthy pundits think?

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu