summaryrefslogtreecommitdiff
path: root/MLKDynamicContext.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-09-02 12:01:30 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-09-02 12:01:30 +0200
commit34682b0b087a9ced1f23a91f67167f71f304a4a8 (patch)
tree70ef9e0a697a3fdfa194ce4819d55ce2b36fc8af /MLKDynamicContext.m
parent84597fcf74fc74672fe664456e62ec6be5f2b066 (diff)
Switch from NS_DURING..NS_HANDLER..NS_ENDHANDLER to @try..@catch..@finally.
Diffstat (limited to 'MLKDynamicContext.m')
-rw-r--r--MLKDynamicContext.m25
1 files changed, 8 insertions, 17 deletions
diff --git a/MLKDynamicContext.m b/MLKDynamicContext.m
index 70979cf..5029a95 100644
--- a/MLKDynamicContext.m
+++ b/MLKDynamicContext.m
@@ -43,6 +43,7 @@
#import "MLKSharpsignColonReader.h"
#import "MLKSymbol.h"
#import "MLKInteger.h"
+#import "MLKUnboundVariableError.h"
#import "runtime-compatibility.h"
#import "util.h"
@@ -359,35 +360,25 @@ static MLKDynamicContext *global_context;
-(id) findRestart:(MLKSymbol *)symbol
{
- NS_DURING
+ @try
{
- NS_VALUERETURN ([_restarts valueForSymbol:symbol], id);
+ return [_restarts valueForSymbol:symbol];
}
- NS_HANDLER
- {
- if (![[localException name] isEqualToString: @"MLKUnboundVariableError"])
- [localException raise];
- }
- NS_ENDHANDLER;
+ @catch (MLKUnboundVariableError *e) { }
return nil;
}
-(id) findHandler:(MLKSymbol *)symbol
{
- NS_DURING
+ @try
{
if (_activeHandlerEnvironment)
- NS_VALUERETURN ([[_activeHandlerEnvironment parent] valueForSymbol:symbol], id);
+ return [[_activeHandlerEnvironment parent] valueForSymbol:symbol];
else
- NS_VALUERETURN ([_conditionHandlers valueForSymbol:symbol], id);
- }
- NS_HANDLER
- {
- if (![[localException name] isEqualToString: @"MLKUnboundVariableError"])
- [localException raise];
+ return [_conditionHandlers valueForSymbol:symbol];
}
- NS_ENDHANDLER;
+ @catch (MLKUnboundVariableError *e) { }
return nil;
}