Comment by librasteve
13 hours ago
Yes, the evolution of Raku multilines is from shell (heredoc) > perl > raku, and a LOT of experience went into the design. Not sure I understand why that's a bad thing?
Some benefits of the Raku solution are:
- multiline is just a superset of the standard quoting method (with the "to:/CLOSER/" adverb)
- indent level is set by the left edge of the closer, in the example 'END' ... so you can consistently indent / unindent your source and do not have to crowd all your heredoc to the left margin
- you can pick any delimiter or closer to avoid conflict with the text content
- there's a large selection of quoting adverbs - q (like single quotes), qq (like double quotes), qw (quote word), qx (shell quoting), etc.
This usually means that any text can be cut and pasted as is into the multiline and you can adjust the adverbs to match the original quoting pattern.
Even with perverse patterns (which you cannot guarantee against in variable text), there is a way to gracefully handle:
q«say '''hi"""» #say '''hi"""
No comments yet
Contribute on Hacker News ↗