Re: Arithmetic operations on custom types

2011-03-01 Thread Stuart Sierra
No, because the arithmetic functions compile down to primitive arithmetic operations. You can define your own generic math functions, but you can't make them as fast as primitives. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups "Clojure

Re: Arithmetic operations on custom types

2011-03-01 Thread Daniel Werner
On Feb 28, 9:31 pm, Seth wrote: > Or, if you dont feel like doing refer-clojure every time, you might be > interested in this:http://planet-clojure.org/page28.html > under "Computing with Units and Dimension" Your link only gives me a 404, unfortunately, but Google's cached text- only version wor

Re: Arithmetic operations on custom types

2011-02-28 Thread Seth
whats wrong with clojure.contrib.generic.arithmetics? Too slow? The only other method that i know of is too : (a). use defprotocol, but this will only dispatch on the first value (b). use gen-class, but this require aot compilation For the first approach, see https://github.com/ztellman/cantor/bl

Arithmetic operations on custom types

2011-02-28 Thread pba
Is it possible to define arithmetic operations like + or * for custom types (like for a coordinate system for example) without using clojure.contrib.generic.arithmetics ? Thanks -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s