diff --git a/Clojure/Clojure/Lib/MultiFn.cs b/Clojure/Clojure/Lib/MultiFn.cs
index 0b4504166..c43208687 100644
--- a/Clojure/Clojure/Lib/MultiFn.cs
+++ b/Clojure/Clojure/Lib/MultiFn.cs
@@ -82,7 +82,7 @@ public IPersistentMap PreferTable
///
volatile object _cachedHierarchy;
- ReaderWriterLockSlim _rw;
+ // ReaderWriterLockSlim _rw;
bool _disposed = false;
//static readonly Var _assoc = RT.var("clojure.core", "assoc");
@@ -112,7 +112,7 @@ public MultiFn(string name, IFn dispatchFn, object defaultDispatchVal, IRef hier
_preferTable = PersistentHashMap.EMPTY;
_hierarchy = hierarchy;
_cachedHierarchy = null;
- _rw = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
+ // _rw = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
}
#endregion
@@ -128,7 +128,7 @@ public MultiFn(string name, IFn dispatchFn, object defaultDispatchVal, IRef hier
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "add")]
public MultiFn addMethod(object dispatchVal, IFn method)
{
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
try
{
_methodTable = MethodTable.assoc(dispatchVal, method);
@@ -137,7 +137,7 @@ public MultiFn addMethod(object dispatchVal, IFn method)
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
}
@@ -150,7 +150,7 @@ public MultiFn addMethod(object dispatchVal, IFn method)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "remove")]
public MultiFn removeMethod(object dispatchVal)
{
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
try
{
_methodTable = MethodTable.without(dispatchVal);
@@ -159,7 +159,7 @@ public MultiFn removeMethod(object dispatchVal)
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
}
@@ -172,7 +172,7 @@ public MultiFn removeMethod(object dispatchVal)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "prefer")]
public MultiFn preferMethod(object dispatchValX, object dispatchValY)
{
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
try
{
if (Prefers(dispatchValY, dispatchValX))
@@ -185,7 +185,7 @@ public MultiFn preferMethod(object dispatchValX, object dispatchValY)
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
}
@@ -242,7 +242,7 @@ private bool Dominates(object x, object y)
///
private IPersistentMap ResetCache()
{
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
try
{
_methodCache = MethodTable;
@@ -251,7 +251,7 @@ private IPersistentMap ResetCache()
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
}
@@ -294,7 +294,7 @@ private IFn GetFn(object dispatchVal)
/// The mest method.
private IFn FindAndCacheBestMethod(object dispatchVal)
{
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
IMapEntry bestEntry;
IPersistentMap mt = _methodTable;
IPersistentMap pt = _preferTable;
@@ -319,11 +319,11 @@ private IFn FindAndCacheBestMethod(object dispatchVal)
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
// ensure basis has stayed stable throughout, else redo
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
try
{
if (mt == _methodTable
@@ -343,7 +343,7 @@ private IFn FindAndCacheBestMethod(object dispatchVal)
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
}
@@ -375,7 +375,7 @@ public IPersistentMap getPreferTable()
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "reset")]
public MultiFn reset()
{
- _rw.EnterWriteLock();
+ // _rw.EnterWriteLock();
try
{
_methodTable = _methodCache = _preferTable = PersistentHashMap.EMPTY;
@@ -384,7 +384,7 @@ public MultiFn reset()
}
finally
{
- _rw.ExitWriteLock();
+ // _rw.ExitWriteLock();
}
}
@@ -787,7 +787,7 @@ private void Dispose(bool disposing)
{
if (disposing)
{
- ((IDisposable)_rw).Dispose();
+ // ((IDisposable)_rw).Dispose();
}
_disposed = true;
diff --git a/Clojure/Clojure/Lib/RT.cs b/Clojure/Clojure/Lib/RT.cs
index e63fc4d6c..0692fc03e 100644
--- a/Clojure/Clojure/Lib/RT.cs
+++ b/Clojure/Clojure/Lib/RT.cs
@@ -3407,8 +3407,8 @@ static IEnumerable GetFindFilePaths()
static IEnumerable GetFindFilePathsRaw()
{
- yield return System.AppDomain.CurrentDomain.BaseDirectory;
- yield return Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "bin");
+ yield return System.Environment.CurrentDirectory;
+ yield return Path.Combine(System.Environment.CurrentDirectory, "bin");
yield return Directory.GetCurrentDirectory();
yield return Path.GetDirectoryName(typeof(RT).Assembly.Location);
diff --git a/Clojure/Clojure/Lib/Ref.cs b/Clojure/Clojure/Lib/Ref.cs
index 5e9d803bd..cedfc2229 100644
--- a/Clojure/Clojure/Lib/Ref.cs
+++ b/Clojure/Clojure/Lib/Ref.cs
@@ -96,7 +96,7 @@ public TVal Next
///
/// Construct a TVal, linked to a previous TVal.
- ///
+ ///
public TVal(object val, long point, TVal prior)
{
_val = val;
@@ -109,7 +109,7 @@ public TVal(object val, long point, TVal prior)
///
/// Construct a TVal, linked to itself.
- ///
+ ///
public TVal(object val, long point)
{
_val = val;
@@ -126,7 +126,7 @@ public TVal(object val, long point)
/// Set the value/point.
///
///
- ///
+ ///
public void SetValue(object val, long point)
{
_val = val;
@@ -141,19 +141,19 @@ public void SetValue(object val, long point)
#region Data
///
- /// Values at points in time for this reference.
+ /// Values at points in time for this reference.
///
TVal _tvals;
///
- /// Values at points in time for this reference.
- ///
- internal TVal TVals
- {
- get { return _tvals; }
- }
-
- ///
+ /// Values at points in time for this reference.
+ ///
+ internal TVal TVals
+ {
+ get { return _tvals; }
+ }
+
+ ///
/// Number of faults for the reference.
///
readonly AtomicInteger _faults;
@@ -161,7 +161,7 @@ internal TVal TVals
///
/// Reader/writer lock for the reference.
///
- readonly ReaderWriterLockSlim _lock;
+ // readonly ReaderWriterLockSlim _lock;
///
/// Info on the transaction locking this ref.
@@ -196,8 +196,8 @@ public int MinHistory
{
get { return _minHistory; }
set { _minHistory = value; }
- }
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "set")]
+ }
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "set")]
public Ref setMinHistory(int minHistory)
{
_minHistory = minHistory;
@@ -210,8 +210,8 @@ public int MaxHistory
{
get { return _maxHistory; }
set { _maxHistory = value; }
- }
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "set")]
+ }
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "set")]
public Ref setMaxHistory(int maxHistory)
{
_maxHistory = maxHistory;
@@ -222,8 +222,8 @@ public Ref setMaxHistory(int maxHistory)
///
/// Used to generate unique ids.
///
- static readonly AtomicLong _ids = new AtomicLong();
-
+ static readonly AtomicLong _ids = new AtomicLong();
+
bool _disposed = false;
#endregion
@@ -250,7 +250,7 @@ public Ref(object initval, IPersistentMap meta)
{
_id = _ids.getAndIncrement();
_faults = new AtomicInteger();
- _lock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
+ // _lock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
_tvals = new TVal(initval, 0);
}
@@ -291,9 +291,9 @@ public Ref(object initval, IPersistentMap meta)
#endregion
- #region History counts
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")]
+ #region History counts
+
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "get")]
public int getHistoryCount()
{
try
@@ -337,21 +337,21 @@ public override object deref()
//Console.WriteLine("Thr {0}, {1}: No-trans get => {2}", Thread.CurrentThread.ManagedThreadId,DebugStr(), ret);
return ret;
}
- return t.DoGet(this);
+ return t.DoGet(this);
}
object currentVal()
{
try
{
- _lock.EnterReadLock();
+ // _lock.EnterReadLock();
if (_tvals != null)
return _tvals.Val;
throw new InvalidOperationException(String.Format("{0} is unbound.", ToString()));
}
finally
{
- _lock.ExitReadLock();
+ // _lock.ExitReadLock();
}
}
@@ -364,7 +364,7 @@ object currentVal()
///
internal void EnterReadLock()
{
- _lock.EnterReadLock();
+ // _lock.EnterReadLock();
}
///
@@ -372,7 +372,7 @@ internal void EnterReadLock()
///
internal void ExitReadLock()
{
- _lock.ExitReadLock();
+ // _lock.ExitReadLock();
}
///
@@ -380,7 +380,7 @@ internal void ExitReadLock()
///
internal void EnterWriteLock()
{
- _lock.EnterWriteLock();
+ // _lock.EnterWriteLock();
}
@@ -389,7 +389,7 @@ internal void EnterWriteLock()
///
internal bool TryEnterWriteLock(int msecTimeout)
{
- return _lock.TryEnterWriteLock(msecTimeout);
+ return true; // _lock.TryEnterWriteLock(msecTimeout);
}
///
@@ -397,7 +397,7 @@ internal bool TryEnterWriteLock(int msecTimeout)
///
internal void ExitWriteLock()
{
- _lock.ExitWriteLock();
+ // _lock.ExitWriteLock();
}
///
@@ -457,8 +457,8 @@ internal void SetValue(object val, long commitPoint)
/// Set the value (must be in a transaction).
///
/// The new value.
- /// The new value.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "set")]
+ /// The new value.
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "set")]
public object set(object val)
{
return LockingTransaction.GetEx().DoSet(this, val);
@@ -469,8 +469,8 @@ public object set(object val)
///
/// The function to apply to the current state and additional arguments.
/// Additional arguments.
- /// The computed value.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "commute")]
+ /// The computed value.
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "commute")]
public object commute(IFn fn, ISeq args)
{
return LockingTransaction.GetEx().DoCommute(this, fn, args);
@@ -481,18 +481,18 @@ public object commute(IFn fn, ISeq args)
///
/// The function to apply to the current state and additional arguments.
/// Additional arguments.
- /// The computed value.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "alter")]
+ /// The computed value.
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "alter")]
public object alter(IFn fn, ISeq args)
{
LockingTransaction t = LockingTransaction.GetEx();
- return t.DoSet(this, fn.applyTo(RT.cons(t.DoGet(this), args)));
+ return t.DoSet(this, fn.applyTo(RT.cons(t.DoGet(this), args)));
}
///
/// Touch the reference. (Add to the tracking list in the current transaction.)
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "touch")]
+ ///
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "touch")]
public void touch()
{
LockingTransaction.GetEx().DoEnsure(this);
@@ -500,10 +500,10 @@ public void touch()
#endregion
- #region IFn Members
-
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "fn")]
+ #region IFn Members
+
+
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "fn")]
public IFn fn()
{
return (IFn)deref();
@@ -666,92 +666,92 @@ public int CompareTo(Ref other)
return _id.CompareTo(other._id);
}
- #endregion
-
- #region object overrides
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(this, obj))
- return true;
-
- Ref r = obj as Ref;
- if (r == null)
- return false;
-
- return _id == r._id;
- }
-
- public override int GetHashCode()
- {
- return _id.GetHashCode();
- }
- #endregion
-
- #region operator overrides
-
- public static bool operator ==(Ref x, Ref y)
- {
- if (ReferenceEquals(x, y))
- return true;
-
- if ((object)x == null)
- return false;
-
- return x.CompareTo(y) == 0;
- }
-
- public static bool operator !=(Ref x, Ref y)
- {
- return !(x == y);
- }
-
- public static bool operator <(Ref x, Ref y)
- {
- if (ReferenceEquals(x, y))
- return false;
-
- if ( ReferenceEquals(x,null) )
- throw new ArgumentException("Cannot compare null","x");
-
- return x.CompareTo(y) < 0;
- }
-
- public static bool operator >(Ref x, Ref y)
- {
- if (ReferenceEquals(x, y))
- return false;
-
- if ( ReferenceEquals(x,null) )
- throw new ArgumentException("Cannot compare null","x");
-
- return x.CompareTo(y) > 0;
- }
-
- #endregion
-
- #region IDisposable
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- private void Dispose(bool disposing)
- {
- if (!_disposed)
- {
- if (disposing)
- {
- if ( _lock != null )
- _lock.Dispose();
- }
-
- _disposed = true;
- }
- }
-
- #endregion
+ #endregion
+
+ #region object overrides
+
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(this, obj))
+ return true;
+
+ Ref r = obj as Ref;
+ if (r == null)
+ return false;
+
+ return _id == r._id;
+ }
+
+ public override int GetHashCode()
+ {
+ return _id.GetHashCode();
+ }
+ #endregion
+
+ #region operator overrides
+
+ public static bool operator ==(Ref x, Ref y)
+ {
+ if (ReferenceEquals(x, y))
+ return true;
+
+ if ((object)x == null)
+ return false;
+
+ return x.CompareTo(y) == 0;
+ }
+
+ public static bool operator !=(Ref x, Ref y)
+ {
+ return !(x == y);
+ }
+
+ public static bool operator <(Ref x, Ref y)
+ {
+ if (ReferenceEquals(x, y))
+ return false;
+
+ if ( ReferenceEquals(x,null) )
+ throw new ArgumentException("Cannot compare null","x");
+
+ return x.CompareTo(y) < 0;
+ }
+
+ public static bool operator >(Ref x, Ref y)
+ {
+ if (ReferenceEquals(x, y))
+ return false;
+
+ if ( ReferenceEquals(x,null) )
+ throw new ArgumentException("Cannot compare null","x");
+
+ return x.CompareTo(y) > 0;
+ }
+
+ #endregion
+
+ #region IDisposable
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ private void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ if (disposing)
+ {
+ // if ( _lock != null )
+ // _lock.Dispose();
+ }
+
+ _disposed = true;
+ }
+ }
+
+ #endregion
}
}
diff --git a/unity-build.sh b/unity-build.sh
new file mode 100755
index 000000000..dbfa27c42
--- /dev/null
+++ b/unity-build.sh
@@ -0,0 +1 @@
+EnableNuGetPackageRestore=true xbuild Clojure/build.proj /target:"Dist" /p:Runtime="Mono" /p:Configuration="Release 3.5" /p:Platform="Any CPU"