summaryrefslogtreecommitdiff
path: root/src/cli/runtime/Var.cs
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-05-23 21:28:12 +0000
committerRich Hickey <richhickey@gmail.com>2006-05-23 21:28:12 +0000
commitd65b16bde7ffb8caa020472cb7a88b03e128ee4f (patch)
treee6333e56dcc4f846ba413a1c8675061ed07794e1 /src/cli/runtime/Var.cs
parent494fd9c97ce10cbe481e2b35eafa3c044ea093ac (diff)
made Var a Symbol in a Namespace
Diffstat (limited to 'src/cli/runtime/Var.cs')
-rw-r--r--src/cli/runtime/Var.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cli/runtime/Var.cs b/src/cli/runtime/Var.cs
index 46f96654..2e4f666c 100644
--- a/src/cli/runtime/Var.cs
+++ b/src/cli/runtime/Var.cs
@@ -12,9 +12,9 @@ using System;
namespace org.clojure.runtime
{
-public class Var : Indexer
+public class Var : AFn
{
-public String name; public Namespace ns; public Cons binding; public IFn fn; //todo, bind to throw stub? public IFn setfn; internal Var(String name, Namespace ns) { this.ns = ns; this.name = name; } public String toString() { if(ns == null) return "#:" + name; return ns.name + ":" + name; } public Var bind(Object val) { if(binding == null) binding = new Cons(val,null); else binding.first = val;
+public readonly Symbol sym; public Namespace ns; public Cons binding; public IFn fn; //todo, bind to throw stub? public IFn setfn; internal Var(Symbol sym, Namespace ns) { if(sym.GetType() != typeof(Symbol)) throw new ArgumentException("Only simple symbols can be vars"); this.ns = ns; this.sym = sym; } public String toString() { if(ns == null) return "#:" + sym; return ns.name + ":" + sym; } public Var bind(Object val) { if(binding == null) binding = new Cons(val,null); else binding.first = val;
if (val is IFn)
this.fn = (IFn)val;