From 34682b0b087a9ced1f23a91f67167f71f304a4a8 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 2 Sep 2008 12:01:30 +0200 Subject: Switch from NS_DURING..NS_HANDLER..NS_ENDHANDLER to @try..@catch..@finally. --- MLKEnvironment.m | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'MLKEnvironment.m') diff --git a/MLKEnvironment.m b/MLKEnvironment.m index d057a8c..13abce4 100644 --- a/MLKEnvironment.m +++ b/MLKEnvironment.m @@ -23,6 +23,7 @@ #import #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]; } -- cgit v1.2.3