On Tue, Jun 22, 2010 at 7:46 AM, Rich Hickey <[email protected]> wrote: > It is precisely for these reasons that the first iteration was based upon > BigInteger contagion.
Yeah, I still don't like BigInteger contagion, and I believe I would vastly prefer the current equals branch, even with its idiosyncrasies, versus BigInteger contagion. I just think it makes things so much simpler when there is one standard type representation for each number. Perhaps there are sides to this I haven't yet considered, but based on my current understanding of the tradeoffs, that's how I feel. > It would be easy, and is likely, to have bigint literals require the N > suffix, in that way there is no hiding the use of bigints as you have. One of my points was that you can create a "hidden" bigint through a chain of non-auto-promoting operations that begin with longs, divide to get fractions, and multiply the fractions to get a bigint. So it is possible to get a bigint without ever using an "N" and without ever using one of the primed operators. I can't believe I'm saying this, but if you're going to try to orient Clojure around primitive math, I almost wonder if it would be cleaner to rip out *more* pieces of the numeric tower. Make Clojure math only work on longs and doubles. Make it so the default ops error if they receive anything other than longs or doubles as inputs, or would produce anything other than longs or doubles as the output. Make it so only the "primed" operators will do math with bigints, rationals, or bigdecimals. In my own code, numbers are generally generated by range, and then end up getting stored in and retrieved from collections. I assume that under all the scenarios on the table, numbers in collections will still have to be boxed? Will they be automatically converted to primitives as math is done to them so that further computations will reap the benefits, or is boxing contagious? -- 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
