From 2212ddd3122b6f0799b4ed73e77aeeea7c19c34c Mon Sep 17 00:00:00 2001 From: Rich Hickey Date: Tue, 26 Sep 2006 20:24:16 +0000 Subject: interim checkin --- src/cli/runtime/Module.cs | 9 ++++++++- src/cli/runtime/RT.cs | 7 +++++++ src/cli/runtime/Var.cs | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/cli/runtime') diff --git a/src/cli/runtime/Module.cs b/src/cli/runtime/Module.cs index e2c091fe..3e396783 100644 --- a/src/cli/runtime/Module.cs +++ b/src/cli/runtime/Module.cs @@ -52,7 +52,14 @@ static public Module findOrCreate(String name) return ns; } } - + +public Var find(Symbol sym){ + lock(vars) + { + return (Var) vars[sym]; + } +} + static public Var intern(String ns, String name) { return findOrCreate(ns).intern(Symbol.intern(name)); diff --git a/src/cli/runtime/RT.cs b/src/cli/runtime/RT.cs index bb0c3886..7a932f78 100644 --- a/src/cli/runtime/RT.cs +++ b/src/cli/runtime/RT.cs @@ -13,6 +13,7 @@ using System; using System.Collections; using System.IO; +using System.Threading; namespace clojure.lang { @@ -27,6 +28,12 @@ public class RT static public readonly Object[] chars; + static int id = 1; + static public int nextID() + { + return Interlocked.Increment(ref id); + } + static RT(){ chars = new Object[256]; for(int i=0;i