Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

clojure.lang.Numbers combines 3 things:

  1. a set of type based rules for math
  2. information about types
  3. actually implementations of the methods require for #1

an example of #1 is "if any args are floating point, the result is floating point" but this knowledge is spread through out a number of methods, and is only derivable if you know which types are floating point and work backwards from there.

A nicer approach would be to encode #1 as actually rules written up in core.logic, #2 as a database of information about types for a specific platform. I think #3 can also be generated from #1 and #2 but I am on shakier ground there.

From this approach we can use the rules with a different database of type information to generate a math runtime for a different platform (like the clr? beam?).

Labels: