calo_mir
Aug 22 2009, 05:39
How do I assert that the value of a variable is of a given type?
I wasted over an hour yesterday searching for a bug that would never have occurred had the language allowed me to check that a variable was not nil and was numeric.
Additionally, I wouldn't have spent an hour searching had the compiler actually given error messages that were even vaguely accurate.
This is a feature common to every scripting language I can think of (except Perl, perhaps). I can't see anything in the wiki that suggests this is possible to do.
I wasted over an hour yesterday searching for a bug that would never have occurred had the language allowed me to check that a variable was not nil and was numeric.
Additionally, I wouldn't have spent an hour searching had the compiler actually given error messages that were even vaguely accurate.
This is a feature common to every scripting language I can think of (except Perl, perhaps). I can't see anything in the wiki that suggests this is possible to do.