I can't speak for Rich, but your suggestion would mean an additional if statement being executed every time you call +. Not sure if Hotspot (or other JVMs) would compile that away or not...
Colin On Jan 13, 3:31 pm, RJ Nowling <rnowl...@gmail.com> wrote: > Hi all, > > I've been reading about the changes to Clojure that are occurring with > regards to improving performance of arithmetic operations. For > example, + no longer auto promotes and +' has been introduced as an > auto-promoting addition operator. > > The idea of introducing additional syntax is a bit odd to me, so I had > thought that it could be solved by setting an environmental variable > for the namespace and the use of macros. For example, maybe set > *enhanced-primitive-support* true or false will determine the behavior > of the operators (+, -, etc.) for an entire namespace. If a user > wants a different set of behaviors for a block of code in that > namespaces, they could wrap the code in a macro called something like > enhanced-primitive-support or old-primitive-support: > > (enhanced-primitive-support (+ a b) ) > > I was wondering why an approach like this was not taken? > > Thanks, > RJ -- 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