Hi,

Thanks for your mail, glad to get ideas so fast :)

On Wed, 21 Dec 2011 09:51:04 +0100
Linus Ericsson <[email protected]> wrote:

> I would def a protocol CustomArithmetics and include the the
> nescessary methods for arithmetics, and then a deftype for each
> custom arithmetics. It would be possible to extend the protocol for
> Longs and Integers as well, if needed.
> 
> If you would like to use the normal operator-names +,- etc then make
> sure that exclude those in the ns-declaration where I would use
> refer :exclude ... and then redefine them as above.

So I'd have to exclude them, include them by some other name, and use
them for the "normal" number types, so I don't break + for normal
numbers, right?

But that also means, that any consumer of my ranged numbers, would be
forced to use my own version of +, - etc. Right? I'm exploring what is
possible with Clojure, this is not anything that I actually need for
something.

regards,
Marek

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to