diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-26 20:19:41 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-26 20:19:41 +0200 |
commit | 96b3e70222d5ac608467f87d70f404771cd58e19 (patch) | |
tree | 4a2725d5c98a28eaa112a7fd1ea43348a66f7d08 | |
parent | 13b5f90b8ef2d7af33688ae6ea644fcd76d16f58 (diff) |
Print quasiquoted expressions in a more legible way.
-rw-r--r-- | MLKCons.m | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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]]; } |