I opened issue CLJS-457 for this enhancement/bug. As a workaround, one can test for undefined?, although that is not really the same and cljs-specific, but for my use case that will do.
Thanks, Frank. On Jan 15, 2013, at 5:32 AM, David Nolen <dnolen.li...@gmail.com> wrote: > This is an unrelated issue. We could probably simulate this by creating a > Unbound type and initializing def'ed vars without init expressions to > instances of it. > > David > > > On Tue, Jan 15, 2013 at 1:08 AM, Frank Siebenlist > <frank.siebenl...@gmail.com> wrote: > ClojureScript:cljs.user> (def a nil) > nil > ClojureScript:cljs.user> (def b) > > ClojureScript:cljs.user> (= a b) > true > -------- > user=> (def a nil) > #'user/a > user=> (def b) > #'user/b > user=> (= a b) > false > -------- > > I didn't realize that the above is dark cave material ;-) > > Could you elaborate a little on the desirable aspect? > (I'm not arguing - only trying to understand as I have just been bitten by > this behavior) > > Thanks, FrankS. > > > > > On Jan 14, 2013, at 9:25 PM, David Nolen <dnolen.li...@gmail.com> wrote: > > > This behavior is desirable. Unless you are in some dark cave of interop you > > shouldn't care. > > > > On Tuesday, January 15, 2013, Frank Siebenlist wrote: > > ClojureScript:cljs.user> (def a nil) > > nil > > ClojureScript:cljs.user> (def b) > > > > ClojureScript:cljs.user> (undefined? a) > > false > > ClojureScript:cljs.user> (undefined? b) > > true > > ClojureScript:cljs.user> (nil? a) > > true > > ClojureScript:cljs.user> (nil? b) > > true > > ClojureScript:cljs.user> (type a) > > nil > > ClojureScript:cljs.user> (type b) > > nil > > ClojureScript:cljs.user> (goog.typeOf a) > > "null" > > ClojureScript:cljs.user> (goog.typeOf b) > > "undefined" > > ClojureScript:cljs.user> (= a b) > > true > > > > > > That doesn't feel right… does it? > > > > Definitely different from clojure… although it's difficult to compare > > without vars in cljs. > > > > -FrankS. > > > > > > > > -- > > 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 > > -- > 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 -- 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