Refactors each TypeDispatcher to have its own separate collection
of types. Add isnan function which returns a boolean if that type
is present, otherwise returns the number 1 for true, and 0 for fase.
This test turned out to be a very discerning one. Adding it uncovered
numerous bugs, large and small, in the TypeDispatcher. The most major
one was that a Map distinguishes keys by strict equality, and hence
since every lookup for a cached behavior was using a newly-generated array
of types, the cache was never being hit. So it looked like methods were
being updated as dependencies changed, when what was really happening
was that the behavior was simply being regenerated from scratch on every
call, which would not be performant as the prototype scaled.
This bug is now fixed (by switching to a third-party ArrayKeyedMap), along
with many smaller bugs too numerous to list.
It should now be feasible to go through Pocomath and add all of the functions
that depend on numbers and booleans only.
Also adds implicit conversion configuration option to Type constructor,
and institutes a numbers-only bundle, and supports argument matching
with implicit conversions.
Still need to test that a behavior that invokes implicit conversion ends up
with the conversion operation as a dependency (and so regenerates itself if
the conversion changes).
* Defines a BooleanT type
* adds options to the Type constructor, so far just to allow conversions
from other types
* renames Number type to NumberT
* records the name of types, and puts the name in the string representation
* defines a conversion fron BooleanT to NumberT, specified to be automatic
* stub code for automatic conversions, not yet complete
* BooleanT not yet added to nanomath
Checked that the new facilities do not disrupt the prior behavior on numbers.