summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-24 18:49:02 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-24 18:49:02 +0200
commit1935a12096ad737edf5ec94e5b7a18980566f9ab (patch)
tree7f6ccbfabd78fcb3ae8bcd3934de1793d38f3359
parente074f91e6aa1a895000673b1ac4df6266ba47094 (diff)
Remove class MLKError.
-rw-r--r--GNUmakefile2
-rw-r--r--MLKError.h33
-rw-r--r--MLKError.m46
-rw-r--r--MLKFloat.m6
-rw-r--r--MLKPackage.m1
-rw-r--r--MLKStream.m9
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
diff --git a/MLKFloat.m b/MLKFloat.m
index 898ef2f..869726b 100644
--- a/MLKFloat.m
+++ b/MLKFloat.m
@@ -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;