summaryrefslogtreecommitdiff
path: root/MLKEnvironment.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 /MLKEnvironment.m
parent84597fcf74fc74672fe664456e62ec6be5f2b066 (diff)
Switch from NS_DURING..NS_HANDLER..NS_ENDHANDLER to @try..@catch..@finally.
Diffstat (limited to 'MLKEnvironment.m')
-rw-r--r--MLKEnvironment.m19
1 files changed, 10 insertions, 9 deletions
diff --git a/MLKEnvironment.m b/MLKEnvironment.m
index d057a8c..13abce4 100644
--- a/MLKEnvironment.m
+++ b/MLKEnvironment.m
@@ -23,6 +23,7 @@
#import <Foundation/NSSet.h>
#import "MLKEnvironment.h"
+#import "MLKUnboundVariableError.h"
#import "NSObject-MLKPrinting.h"
#import "runtime-compatibility.h"
#import "util.h"
@@ -79,9 +80,9 @@
MLKBinding *binding;
if (!(binding = [self bindingForSymbol:symbol]))
- [NSException raise:@"MLKUnboundVariableError"
- format:@"The variable %@ is unbound.",
- MLKPrintToString(symbol)];
+ @throw LAUTORELEASE ([[MLKUnboundVariableError alloc]
+ initWithSymbol:symbol
+ inEnvironment:self]);
[binding setValue:value];
}
@@ -91,9 +92,9 @@
MLKBinding *binding;
if (!(binding = [self bindingForSymbol:symbol]))
- [NSException raise:@"MLKUnboundVariableError"
- format:@"The variable %@ is unbound.",
- MLKPrintToString(symbol)];
+ @throw LAUTORELEASE ([[MLKUnboundVariableError alloc]
+ initWithSymbol:symbol
+ inEnvironment:self]);
return [binding value];
}
@@ -157,9 +158,9 @@
-(void) setBinding:(MLKBinding *)binding forSymbol:(MLKSymbol *)symbol
{
if (![self bindingForSymbol:symbol])
- [NSException raise:@"MLKUnboundVariableError"
- format:@"The variable %@ is unbound.",
- MLKPrintToString(symbol)];
+ @throw LAUTORELEASE ([[MLKUnboundVariableError alloc]
+ initWithSymbol:symbol
+ inEnvironment:self]);
[self addBinding:binding forSymbol:symbol];
}