Nope, JavaScript has a terrible notion of truth. What if you want to add functionality to numbers? Or strings? 0 and blank strings are false-y.
That said I have a branch where we inline the truth test which does a give a perf boost on many JS engines. This needs to benchmarked more thoroughly before we consider merging it in. David On Thu, Mar 8, 2012 at 3:13 PM, Philip K <p...@eleven-percent.at> wrote: > I see the rationale now, thanks. One question though, isn't it possible to > generate: > > if (self && self.func) { > return self.func(self); > } > > instead of > > if (truth(truth(self) ? self.func : self)) { > return self.func(self); > } > > -- > 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 > -- 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