summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-17 15:19:08 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-17 15:20:25 +0200
commit650385128d0e31777e51d2bc9c1f79f15e966cd8 (patch)
tree594407176cc1c149c430a2289df497144a36a9c7
parentc22d1dfba82475d19896c04bd1c217677a97ad6e (diff)
MLKCons: Do not crash when displaying a cons whose cdr is a fixnum.
-rw-r--r--MLKCons.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/MLKCons.m b/MLKCons.m
index bee917f..9e49d45 100644
--- a/MLKCons.m
+++ b/MLKCons.m
@@ -146,7 +146,7 @@
if (!_cdr)
return [NSString stringWithFormat:@"%@",
MLKPrintToString(_car)];
- else if ([_cdr isKindOfClass:[MLKCons class]])
+ else if (MLKInstanceP (_cdr) && [_cdr isKindOfClass:[MLKCons class]])
return [NSString stringWithFormat:@"%@ %@",
MLKPrintToString(_car),
[_cdr bareDescriptionForLisp]];
@@ -158,7 +158,7 @@
-(NSString *)descriptionForLisp
{
- if ([_cdr isKindOfClass:[MLKCons class]])
+ if (MLKInstanceP (_cdr) && [_cdr isKindOfClass:[MLKCons class]])
{
if (_car == [[MLKPackage findPackage:@"COMMON-LISP"] intern:@"QUOTE"])
return [NSString stringWithFormat:@"'%@", [_cdr bareDescriptionForLisp]];