HCoop
/
jackhill
/
mal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
daad7ec
)
perl: Use more string interpolation in the printer.
author
Ben Harris
<bjh21@bjh21.me.uk>
Mon, 29 Jul 2019 23:07:43 +0000
(
00:07
+0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Tue, 30 Jul 2019 08:56:25 +0000
(09:56 +0100)
perl/printer.pm
patch
|
blob
|
blame
|
history
diff --git
a/perl/printer.pm
b/perl/printer.pm
index
21ca73f
..
64e7cc0
100644
(file)
--- a/
perl/printer.pm
+++ b/
perl/printer.pm
@@
-33,16
+33,16
@@
sub _pr_str {
$str =~ s/\\/\\\\/g;
$str =~ s/"/\\"/g;
$str =~ s/\n/\\n/g;
- return
'"' . $str . '
"';
+ return
qq'"$str
"';
} else {
return $$obj;
}
} elsif ($obj->isa('Mal::Atom')) {
return '(atom ' . _pr_str($$obj) . ")";
} elsif ($obj->isa('Mal::Function')) {
- return
'<fn* ' . $obj . '>'
;
+ return
"<fn* $obj>"
;
} elsif ($obj->isa('Mal::Macro')) {
- return
'<macro* ' . $obj . '>'
;
+ return
"<macro* $obj>"
;
} else {
return $$obj;
}