data structures can be used as functions. Emitting foo.call supports this. David
On Tue, Sep 9, 2014 at 5:06 AM, Yehonathan Sharvit <[email protected]> wrote: > I am wondering why the cljs compiler emits code that calls functions using > call and not straight js function call. > > for instance: > > (defn foo []) > (foo) > > is compiled to: > user.foo = function() { > return null; > }; > > user.foo.call(null); > > > My question is why the compiler didn't emit the following: > > user.foo(); > > > Thanks/ > > -- > Note that posts from new members are moderated - please be patient with your > first post. > --- > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/clojurescript. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
