diff options
| author | Rich Hickey <richhickey@gmail.com> | 2007-12-02 20:25:00 +0000 |
|---|---|---|
| committer | Rich Hickey <richhickey@gmail.com> | 2007-12-02 20:25:00 +0000 |
| commit | d647fbb3dc2027e837077cd94aaa9b2ffe3689eb (patch) | |
| tree | 39f2547abd5ecab201d27f04ac667f77649364a8 /src/jvm | |
| parent | 139ddd146f2a272b7ddda397f54b501ff499c643 (diff) | |
new Ref system, (list) returns ()
Diffstat (limited to 'src/jvm')
| -rw-r--r-- | src/jvm/clojure/lang/IRef.java | 6 | ||||
| -rw-r--r-- | src/jvm/clojure/lang/Ref.java | 2 | ||||
| -rw-r--r-- | src/jvm/clojure/lang/Var.java | 4 |
3 files changed, 3 insertions, 9 deletions
diff --git a/src/jvm/clojure/lang/IRef.java b/src/jvm/clojure/lang/IRef.java index e9d8417f..e9acfa57 100644 --- a/src/jvm/clojure/lang/IRef.java +++ b/src/jvm/clojure/lang/IRef.java @@ -133,7 +133,7 @@ public Object alter(IFn fn, ISeq args) throws Exception{ if(trans != null) throw new Exception("Cannot alter an IRef in a transaction"); if(inAlter.get() != null) - throw new Exception("Cannot nest alters, use commute"); + throw new Exception("Cannot nest alters, use send"); try { @@ -148,7 +148,7 @@ public Object alter(IFn fn, ISeq args) throws Exception{ return this; } -public Object commute(IFn fn, ISeq args) throws Exception{ +public Object send(IFn fn, ISeq args) throws Exception{ if(errors != null) { throw new Exception("IRef has errors", (Exception) RT.first(errors)); @@ -176,7 +176,7 @@ public Object set(Object val) throws Exception{ if(trans != null) throw new Exception("Cannot set an IRef in a transaction"); if(inAlter.get() != null) - throw new Exception("Cannot nest alters, use commute"); + throw new Exception("Cannot nest alters, use send"); setState(val); return val; } diff --git a/src/jvm/clojure/lang/Ref.java b/src/jvm/clojure/lang/Ref.java index 4d81efed..b5c2b6bd 100644 --- a/src/jvm/clojure/lang/Ref.java +++ b/src/jvm/clojure/lang/Ref.java @@ -18,7 +18,5 @@ Object get() throws Exception; Object alter(IFn fn, ISeq args) throws Exception; -Object commute(IFn fn, ISeq args) throws Exception; - Object set(Object val) throws Exception; } diff --git a/src/jvm/clojure/lang/Var.java b/src/jvm/clojure/lang/Var.java index ac020867..feb2fd95 100644 --- a/src/jvm/clojure/lang/Var.java +++ b/src/jvm/clojure/lang/Var.java @@ -133,10 +133,6 @@ public Object alter(IFn fn, ISeq args) throws Exception{ return this; } -public Object commute(IFn fn, ISeq args) throws Exception{ - return alter(fn,args); -} - public Object set(Object val){ Box b = getThreadBinding(); if(b != null) |
