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. --- MLKReadEvalPrintLoop.m | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'MLKReadEvalPrintLoop.m') diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m index 0e213b0..e3700ea 100644 --- a/MLKReadEvalPrintLoop.m +++ b/MLKReadEvalPrintLoop.m @@ -51,7 +51,7 @@ static char **_argv; static const char *prompt (EditLine *e) { - NS_DURING + @try { MLKPackage *package = [[MLKDynamicContext currentContext] valueForSymbol:[[MLKPackage @@ -60,14 +60,13 @@ static const char *prompt (EditLine *e) { return [[NSString stringWithFormat:@"%@> ", [package name]] UTF8String]; } - NS_HANDLER + @catch (NSException *localException) { printf ("Caught an unhandled exception.\nName: %s\nReason: %s\n", [[localException name] UTF8String], [[localException reason] UTF8String]); return "> "; } - NS_ENDHANDLER } @@ -102,7 +101,7 @@ static const char *prompt (EditLine *e) { printf ("Loading init.lisp.\n"); #if 1 - NS_DURING + @try { #endif input = [NSInputStream inputStreamWithFileAtPath:@"init.lisp"]; @@ -117,13 +116,12 @@ static const char *prompt (EditLine *e) { [input close]; #if 1 } - NS_HANDLER + @catch (NSException *localException) { printf ("Caught an unhandled exception.\nName: %s\nReason: %s\n", [[localException name] UTF8String], [[localException reason] UTF8String]); } - NS_ENDHANDLER; #endif printf ("Done.\n\n"); @@ -159,7 +157,7 @@ static const char *prompt (EditLine *e) { break; #if 1 - NS_DURING + @try #else #ifdef GNUSTEP GSDebugAllocationActive (YES); @@ -185,13 +183,12 @@ static const char *prompt (EditLine *e) { } } #if 1 - NS_HANDLER + @catch (NSException *localException) { printf ("Caught an unhandled exception.\nName: %s\nReason: %s\n", [[localException name] UTF8String], [[localException reason] UTF8String]); } - NS_ENDHANDLER; #endif LRELEASE (pool); -- cgit v1.2.3