From 96b3e70222d5ac608467f87d70f404771cd58e19 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 26 Jul 2008 20:19:41 +0200 Subject: Print quasiquoted expressions in a more legible way. --- MLKCons.m | 16 ++++++++++++---- 1 file 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]]; } -- cgit v1.2.3