On Thu, Jan 19, 2012 at 11:18 AM, Gijs S. <gijsstuur...@gmail.com> wrote:
> Subject: = in ClojureScript differs from Clojure API for arities other > than 2 > > Using ClojureScript f4c0de502c92ce710da923888d672f22213b902c (checked > out on Thu Jan 19 2012) > => (= 1) > false ;; incorrect > > => (= 1 1) > true > > => (= 1 1 2) > true ;; incorrect > > => (= 1 1 1) > true ;; correct, but by accident > > In Clojure and according to Clojure's API = is defined for all arities > [1,2] > => (= 1) > true > > => (= 1 1) > true > > => (= 1 1 2) > false > > The source of this bug is that = is only implemented in ClojureScript > for the 2 arity [3]. Combined with the javascript behaviour for > superfluous arguments this leads to these unfortunate results. > Implementing = for multi arities in ClojureScript by following the > Clojure implementation should fix this. See for example the < > predicate in ClojureScript [4]. > > My apologies for not using the bug tracker and not supplying a patch. > I am not yet familiar with those systems. > > -Gijs > Open a ticket with this information in JIRA please. It would be nice to get a set of benchmarks with the patch as well. = is a pretty critical fn and supporting multiple arities is a big performance hit. David -- 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