MCPcopy Index your code
hub / github.com/clojure/clojure / Var

Class Var

src/jvm/clojure/lang/Var.java:20–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20public final class Var extends ARef implements IFn, IRef, Settable, Serializable{
21
22private static final long serialVersionUID = 8368961370796295279L;
23
24static class TBox{
25
26volatile Object val;
27final Thread thread;
28
29public TBox(Thread t, Object val){
30 this.thread = t;
31 this.val = val;
32}
33}
34
35static public class Unbound extends AFn{
36 final public Var v;
37
38 public Unbound(Var v){
39 this.v = v;
40 }
41
42 public String toString(){
43 return "Unbound: " + v;
44 }
45
46 public Object throwArity(int n){
47 throw new IllegalStateException("Attempting to call unbound fn: " + v);
48 }
49}
50
51static class Frame{
52 final static Frame TOP = new Frame(PersistentHashMap.EMPTY, null);
53 //Var->TBox
54 Associative bindings;
55 //Var->val
56// Associative frameBindings;
57 Frame prev;
58
59 public Frame(Associative bindings, Frame prev){
60// this.frameBindings = frameBindings;
61 this.bindings = bindings;
62 this.prev = prev;
63 }
64
65 protected Object clone() {
66 return new Frame(this.bindings, null);
67 }
68
69}
70
71static final ThreadLocal<Frame> dvals = new ThreadLocal<Frame>(){
72
73 protected Frame initialValue(){
74 return Frame.TOP;
75 }
76};
77

Callers

nothing calls this directly

Calls 1

internMethod · 0.95

Tested by

no test coverage detected