diff options
-rw-r--r-- | GNUmakefile | 2 | ||||
-rw-r--r-- | MLKError.h | 33 | ||||
-rw-r--r-- | MLKError.m | 46 | ||||
-rw-r--r-- | MLKFloat.m | 6 | ||||
-rw-r--r-- | MLKPackage.m | 1 | ||||
-rw-r--r-- | MLKStream.m | 9 |
6 files changed, 11 insertions, 86 deletions
diff --git a/GNUmakefile b/GNUmakefile index f88f6c2..de97da6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -27,7 +27,7 @@ ADDITIONAL_OBJCFLAGS = -Wall ToiletKit_OBJC_FILES = MLKCharacter.m MLKCons.m MLKBinding.m \ MLKDoubleFloat.m MLKDynamicContext.m \ - MLKEndOfFileError.m MLKEnvironment.m MLKError.m \ + MLKEndOfFileError.m MLKEnvironment.m \ MLKFloat.m MLKInteger.m MLKInterpreter.m \ MLKLinkedList.m MLKLexicalContext.m \ MLKLexicalEnvironment.m MLKLispValue.m \ diff --git a/MLKError.h b/MLKError.h deleted file mode 100644 index 4f399a5..0000000 --- a/MLKError.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- mode: objc; coding: utf-8 -*- */ -/* Étoilisp/Mulklisp, a Common Lisp subset for the Étoilé runtime. - * Copyright (C) 2008 Matthias Andreas Benkard. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#import <Foundation/NSException.h> - -@class NSString; - - -@interface MLKError : NSException -{ - NSString *message; -} - --(MLKError *) initWithMessage:(NSString *)aString; -+(MLKError *) errorWithMessage:(NSString *)aString; - --(void) dealloc; -@end diff --git a/MLKError.m b/MLKError.m deleted file mode 100644 index 6b48aa9..0000000 --- a/MLKError.m +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- mode: objc; coding: utf-8 -*- */ -/* Étoilisp/Mulklisp, a Common Lisp subset for the Étoilé runtime. - * Copyright (C) 2008 Matthias Andreas Benkard. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#import "MLKError.h" -#import "runtime-compatibility.h" - - -@implementation MLKError --(MLKError *) initWithMessage:(NSString *)aString -{ - self = [super init]; - ASSIGN (message, aString); - return self; -} - -+(MLKError *) errorWithMessage:(NSString *)aString -{ - return AUTORELEASE ([[MLKError alloc] initWithMessage:aString]); -} - --(NSString *) reason -{ - return message; -} - --(void) dealloc -{ - RELEASE (message); - [super dealloc]; -} -@end @@ -21,9 +21,10 @@ #import "MLKDoubleFloat.h" #import "MLKPackage.h" #import "MLKDynamicContext.h" -#import "MLKError.h" #import "runtime-compatibility.h" +#import <Foundation/NSException.h> + @implementation MLKFloat : MLKLispValue +(MLKFloat *) floatWithExponentMarker:(unichar)exponentMarker @@ -62,7 +63,8 @@ #define DECLARE_ABSTRACT(SIGNATURE, RETURN_VALUE) \ SIGNATURE \ { \ - [[MLKError errorWithMessage:@"Tried to invoke an abstract method."] raise]; \ + [NSException raise:@"MLKInternalInconsistencyError" \ + format:@"Tried to invoke an abstract method."]; \ return RETURN_VALUE; \ } diff --git a/MLKPackage.m b/MLKPackage.m index f243877..79e4182 100644 --- a/MLKPackage.m +++ b/MLKPackage.m @@ -18,7 +18,6 @@ #import "MLKPackage.h" #import "MLKSymbol.h" -#import "MLKError.h" #import "NSObject-MLKPrinting.h" #import "runtime-compatibility.h" diff --git a/MLKStream.m b/MLKStream.m index 86426e5..c80e6ff 100644 --- a/MLKStream.m +++ b/MLKStream.m @@ -17,9 +17,10 @@ */ #import "MLKStream.h" -#import "MLKError.h" #import "runtime-compatibility.h" +#import <Foundation/NSException.h> + @implementation MLKStream -(MLKStream *) init; @@ -85,7 +86,8 @@ // NSLog (@"%d bytes read", bytes_read); if (!bytes_read) { - [[MLKError errorWithMessage:@"Tried to read beyond end of file."] raise]; + [NSException raise:@"MLKStreamError" + format:@"Tried to read beyond end of file."]; } tmpstr = [[NSString alloc] initWithBytesNoCopy:buffer @@ -106,7 +108,8 @@ -(void) unreadChar:(unichar)ch { if (_charCached) - [[MLKError errorWithMessage:@"Attempted to UNREAD-CHAR twice in a row."] raise]; + [NSException raise:@"MLKInvalidOperationError" + format:@"Attempted to UNREAD-CHAR twice in a row."]; _charCached = YES; _cachedChar = ch; |