<< Back to previous view

[CLJS-457] Implement notion of "unbound", i.e. uninitialized variables, in ClojureScript to mimic Clojure's behaviour Created: 15/Jan/13  Updated: 29/Jul/13

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Frank Siebenlist Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

clojurescript r1552



 Description   

The following REPL snippets show different behavior for "unbound" vars in cljs and clj:

--------
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
--------

As a possible solution, D. Nolen suggested that we could "simulate this by creating a Unbound type and initializing def'ed vars without init expressions to instances of it."


Generated at Tue Sep 23 09:40:41 CDT 2014 using JIRA 4.4#649-r158309.