Re: Testing for NULL

new topic     » goto parent     » topic index » view thread      » older message » newer message
SDPringle said...

Some of us, like myself, say the user should have a set dummy value as values can be either atoms or sequences.

When I read that I suddenly realised that a suitable dummy value could be 0.0 - ie:

    if not integer(d) and d=0 then -- it /is/ the special dummy value 

Of course you'd need some way to artificially create such a beast, and there are a couple of billion other "special values" that should not occur in normal code.

Pete

EDIT: Mind you, it could cause massive confusion and panic when things start being 0 and not 0 at the same time... And of course the d=0 as shown above would be optimized to false because the stupid compiler knows that d is not an integer, though you could use d=MYDUMMY instead. I'll get me coat.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu