summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-07-26 20:19:41 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-07-26 20:19:41 +0200
commit96b3e70222d5ac608467f87d70f404771cd58e19 (patch)
tree4a2725d5c98a28eaa112a7fd1ea43348a66f7d08
parent13b5f90b8ef2d7af33688ae6ea644fcd76d16f58 (diff)
Print quasiquoted expressions in a more legible way.
-rw-r--r--MLKCons.m16
1 files changed, 12 insertions, 4 deletions
diff --git a/MLKCons.m b/MLKCons.m
index 5bc761a..8b3084b 100644
--- a/MLKCons.m
+++ b/MLKCons.m
@@ -113,10 +113,18 @@
-(NSString *)descriptionForLisp
{
- if ([_cdr isKindOfClass:[MLKCons class]]
- && _car == [[MLKPackage findPackage:@"COMMON-LISP"] intern:@"QUOTE"])
- return [NSString stringWithFormat:@"'%@", [_cdr bareDescriptionForLisp]];
- else
+ if ([_cdr isKindOfClass:[MLKCons class]])
+ {
+ if (_car == [[MLKPackage findPackage:@"COMMON-LISP"] intern:@"QUOTE"])
+ return [NSString stringWithFormat:@"'%@", [_cdr bareDescriptionForLisp]];
+ else if (_car == [[MLKPackage findPackage:@"TOILET-SYSTEM"] intern:@"QUASIQUOTE"])
+ return [NSString stringWithFormat:@"`%@", [_cdr bareDescriptionForLisp]];
+ else if (_car == [[MLKPackage findPackage:@"TOILET-SYSTEM"] intern:@"UNQUOTE"])
+ return [NSString stringWithFormat:@",%@", [_cdr bareDescriptionForLisp]];
+ else if (_car == [[MLKPackage findPackage:@"TOILET-SYSTEM"] intern:@"UNQUOTE-SPLICING"])
+ return [NSString stringWithFormat:@",@%@", [_cdr bareDescriptionForLisp]];
+ }
+
return [NSString stringWithFormat:@"(%@)", [self bareDescriptionForLisp]];
}