From f0ebcbc30c8f2ae9144259caed61495ef753ab72 Mon Sep 17 00:00:00 2001 From: Rich Hickey Date: Thu, 27 Jul 2006 22:21:53 +0000 Subject: made set() return Tuple --- src/cli/runtime/Tuple.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/cli/runtime') diff --git a/src/cli/runtime/Tuple.cs b/src/cli/runtime/Tuple.cs index 1ee8de4f..59799b30 100644 --- a/src/cli/runtime/Tuple.cs +++ b/src/cli/runtime/Tuple.cs @@ -37,14 +37,11 @@ public Object get(int i){ return array[i]; } -/** - * - * @param i - * @param val - * @return a PersistentArray - */ + public IArray set(int i, Object val) { - return (new PersistentArray(this)).set(i, val); + Object[] newArray = (Object[])array.Clone(); + newArray[i] = val; + return new Tuple(newArray); } override public bool Equals(Object key){ -- cgit v1.2.3-70-g09d2