I have created a *highly experimental* library for unit-checked math. I realize that there are some existing solutions, but I wanted something more lightweight that would layer on top of the existing Clojure/Java numeric system rather than create a new one. This is designed to provide validation in tests rather than to run in production. It has compile-time switching between checked and unchecked operations, and all numbers are still just the regular Java types. This is achieved by storing a mapping of number instances to units; weak references to the number instances are used to avoid creating a memory leak. This does have the disadvantage that units can't be associated with primitives. The API is also designed to facilitate extension to new operations and types.
https://github.com/WilliamParker/dimensional-math Any thoughts, suggestions, etc. are welcome. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.