Yeah, given that CLJS has no var interning I suppose this is expected behavior.
A safer approach for the init problem you describe would be (defonce foo (delay #_your-init-code-here-maybe-returning js/undefined)) @foo On Saturday, June 6, 2015 at 7:44:45 AM UTC+2, Alice Bellard wrote: > (defonce foo js/undefined) > => nil > > (defonce foo 1) > => 1 > > I put my initialization code to init! and did (defonce _ (init!)) to be > called only once. But incidentally, init! called a javascript function that > returns nothing(undefined) as the last statement, and init! ran every time I > evaluate it! > > Hope this post can save someone's precious time :) -- 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.
