summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MLKDynamicContext.h2
-rw-r--r--MLKDynamicContext.m13
-rw-r--r--MLKEnvironment.h4
-rw-r--r--MLKEnvironment.m4
4 files changed, 19 insertions, 4 deletions
diff --git a/MLKDynamicContext.h b/MLKDynamicContext.h
index bd08800..22014a4 100644
--- a/MLKDynamicContext.h
+++ b/MLKDynamicContext.h
@@ -47,6 +47,8 @@
-(id) findRestart:(MLKSymbol *)symbol;
-(id) findHandler:(MLKSymbol *)symbol;
-(id) findCatchTag:(MLKSymbol *)symbol;
+-(id) valueForBinding:(MLKSymbol *)symbol;
+-(void) setValue:(id)value forBinding:(MLKSymbol *)symbol;
-(void) dealloc;
@end
diff --git a/MLKDynamicContext.m b/MLKDynamicContext.m
index d08deaa..63c8ad7 100644
--- a/MLKDynamicContext.m
+++ b/MLKDynamicContext.m
@@ -142,6 +142,19 @@
return nil;
}
+-(id) valueForBinding:(MLKSymbol *)symbol
+{
+ return [[[MLKDynamicContext currentContext] environment]
+ valueForBinding:symbol];
+}
+
+-(void) setValue:(id)value forBinding:(MLKSymbol *)symbol
+{
+ [[[MLKDynamicContext currentContext] environment]
+ setValue:value
+ forBinding:symbol];
+}
+
-(void) dealloc
{
RELEASE (_conditionHandlers);
diff --git a/MLKEnvironment.h b/MLKEnvironment.h
index b70b5b9..20cf7ce 100644
--- a/MLKEnvironment.h
+++ b/MLKEnvironment.h
@@ -35,8 +35,8 @@
-(MLKEnvironment *) parent;
-(void) addBindings:(NSDictionary *)bindings;
--(void) addBinding:(MLKSymbol *)symbol to:(id)value;
--(void) setBinding:(MLKSymbol *)symbol to:(id)value;
+-(void) addValue:(id)value forBinding:(MLKSymbol *)symbol;
+-(void) setValue:(id)value forBinding:(MLKSymbol *)symbol;
-(id) valueForBinding:(MLKSymbol *)symbol;
-(MLKEnvironment *) environmentForBinding:(MLKSymbol *)symbol;
diff --git a/MLKEnvironment.m b/MLKEnvironment.m
index 8a7c270..8c26519 100644
--- a/MLKEnvironment.m
+++ b/MLKEnvironment.m
@@ -53,7 +53,7 @@
return _parent;
}
--(void) setBinding:(MLKSymbol *)symbol to:(id)value
+-(void) setValue:(id)value forBinding:(MLKSymbol *)symbol;
{
[self setBinding:symbol to:value inEnvironment:self];
}
@@ -96,7 +96,7 @@
[_bindings addEntriesFromDictionary:bindings];
}
--(void) addBinding:(MLKSymbol *)symbol to:(id)value
+-(void) addValue:(id)value forBinding:(MLKSymbol *)symbol;
{
[_bindings setObject:value forKey:symbol];
}