summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-07-06 17:20:21 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-07-06 17:20:21 +0200
commitaab0da6f05ab8f962b8b7c096c7a5c132dbdbff6 (patch)
treec305a415615f968d5e1bb0a5a54c40823ce740cb
parent90fedd6e46208b51acfe80c7de0bca8f3e45bb8d (diff)
Remove reliance on Mac OS X 10.5 features.
-rw-r--r--MLKEnvironment.h2
-rw-r--r--MLKEnvironment.m15
2 files changed, 13 insertions, 4 deletions
diff --git a/MLKEnvironment.h b/MLKEnvironment.h
index bb35067..0e67c22 100644
--- a/MLKEnvironment.h
+++ b/MLKEnvironment.h
@@ -20,6 +20,7 @@
#import "MLKLispValue.h"
#import "MLKSymbol.h"
+#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSString.h>
@@ -39,6 +40,7 @@
-(MLKEnvironment *) parent;
+-(NSArray *) bindingArray;
-(NSSet *) bindings;
-(void) addBinding:(MLKBinding *)binding forSymbol:(MLKSymbol *)symbol;
-(void) setBinding:(MLKBinding *)binding forSymbol:(MLKSymbol *)symbol;
diff --git a/MLKEnvironment.m b/MLKEnvironment.m
index 7119bac..c557f79 100644
--- a/MLKEnvironment.m
+++ b/MLKEnvironment.m
@@ -58,12 +58,19 @@
return _parent;
}
+-(NSArray *) bindingArray
+{
+ NSMutableArray *array = [NSMutableArray arrayWithArray:[_bindings allKeys]];
+
+ if (_parent)
+ [array addObjectsFromArray:[_parent bindingArray]];
+
+ return array;
+}
+
-(NSSet *) bindings
{
- NSSet *set = [NSSet setWithArray:[_bindings allKeys]];
- return (_parent
- ? (id)[set setByAddingObjectsFromSet:[_parent bindings]]
- : (id)set);
+ return [NSSet setWithArray:[self bindingArray]];
}
-(void) setValue:(id)value forSymbol:(MLKSymbol *)symbol;