Strangely Consistent

Musings about programming, Perl 6, and programming Perl 6

When I don't even feel like using blame

The other day we ran into a bug in the following code in the Perl 6 setting:

multi method sign(Real:D:) {
    self < 0 ?? -1 !! self == 0 ?? 0 !! 1

Kudos to you if you automatically start poring over the cases in that function, trying to see which one is the wrong one. You won't find it though.

The function implements what is more or less the mathematical definition of the sign (or sgn) function:

          | -1      if x  < 0
sign(x) = |  0      if x == 0
          | +1      if x  > 0

The method does exactly this. So what's the problem?

Right, NaN.

Before the bug was fixed, you'd get this, which is surely wrong:

$ perl6 -e 'say sign(NaN)'

Oh, and this is what the fixed code looks like:

multi method sign(NaN:)    { NaN }
multi method sign(Real:D:) { self < 0 ?? -1 !! self == 0 ?? 0 !! 1 }

(That is, original method remains the same, but a new multi candidate handles the NaN-invocant case.)

And now it does the right thing:

$ perl6 -e 'say sign(NaN)'

I'm trying to come up with an appropriate emotion to go with this kind of bug. It's hard to muster any strong sentiment either way, but I think it's appropriate to say I'm sick of this kind of bug. I wish it were a thing of the past. It feels like it should be a thing of the past.

See, the code looks right. It's based right off of the mathematical definition of real numbers. The only slight mistake the original author made was briefly forgetting about the strange numeric value IEEE 754 specifies called "not a number" (NaN), which demands to be taken into account when doing this kind of exhaustive case-matching.

Don't get me wrong. NaN is there for a reason, and I'm not clamoring for its removal. The IEEE 754 people certainly had their hearts and their heads in the right place. They got a lot of things right, including the inclusion of NaN. There has to be something that's returned when you take the square root of negative 1, or multiply zero with infinity, or try to find a limit which doesn't exist.

No, what frustrates and exhausts me is that it's 2015, and we're still creating bugs rooted in lack of exhaustive case-matching. This should be a solved problem by now. We ought to have moved on to more interesting challenges.

And indeed, solutions exist out there. There are linters that will point out when you've left out an important case. (Not for Perl 6, yet, but there's nothing to stop us from having one.) Some languages have case statements over enum types where you're not allowed to leave out a case. Nowadays we also handle things with Maybe or Option types.

These things are not even fancy new technology at this point. They're proven to work, and to improve the incidence of thinkos and the quality of code. If we're not equipped with a language (or tooling) that checks this stuff for us, we're part of a rapidly shrinking unfortunate majority. If we're not looking to fix that in our home language, we're increasingly irresponsible and reckless.

This is what computing machines are good at! Enumerating cases! We should be having them do that all the time, on our business-critical code. Or, conversely, just writing code without the safety net of full enumeration of cases should be rightly recognized as belonging with other barbaric development practices of the mid-20th century, surely caused by extreme scarcity of memory or CPU, but which we have — ought to have — grown out of by now.

But... sigh... yes, the code looks right. Which is why I don't particularly feel like running git blame on it this time.

Maybe the code snippet was even code-reviewed, and someone had looked at it, nodded, and (at some more or less conscious level) noted that the code aligns perfectly with the mathematical three-case definition. A real number is either smaller than, equal to, or greater than zero. Sure, we know that! This hypothetical code reviewer did not have alarm bells go off just becase the case of NaN wasn't considered. Because NaN is an exception, a fairly uncommon one, and humans enjoy thinking about happy paths.

A lot of what constitutes "experience" in a developer seems to be installing these alarm bells in prominent places in one's brain, so that one can write code that's "robust" in the face of unusual values and unhappy paths. Two other such cases spring to mind:

(And indeed, NaN is a kind of "null value" for floating-point numbers.)

But it's also about considering edge cases in general. What if the list is empty when we ask for an element? What if the network is unavailable when we try to access a web service? What if the player can exceed 2,147,483,647 points in the game? Things like this can, and should be checked automatically, by the machine, as we developers worry about higher levels of abstraction.

Don't settle for less. Let the machine check that we've considered all the cases.

Send more money (in Perl 6)

In which I implement four different Perl 6 solutions to MJD's SEND + MORE = MONEY challenge.

I encourage you to read that post if you haven't already, but here's a short tl;dr: Haskell's do notation is wonderful in that it allows the author to cleanly express a backtracking algorithm without any "noise" such as explicit backtracking information, or indentation. Monads may be weird and frightening, but proponents of other languages should take heed: do notation is nice.

Can we do as nicely in Perl 6?

Version A: recursion

Here we're trying to get as close as possible to the original Haskell code without using any tricks. Basically trying to match the essence of the problem line by line. We're hampered by not having a do notation, of course, and no built-in backtracking in the main language. The program pretends to have no indentation, because the indentation isn't really relevant.

my @digits = 0..9;

choose @digits (-) 0, -> $s {
choose @digits (-) $s, -> $e {
choose @digits (-) ($s, $e), -> $n {
choose @digits (-) ($s, $e, $n), -> $d {
my $send = :10[$s, $e, $n, $d];

choose @digits (-) (0, $s, $e, $n, $d), -> $m {
choose @digits (-) ($s, $e, $n, $d, $m), -> $o {
choose @digits (-) ($s, $e, $n, $d, $m, $o), -> $r {
my $more = :10[$m, $o, $r, $e];

choose @digits (-) ($s, $e, $n, $d, $m, $o, $r), -> $y {
my $money = :10[$m, $o, $n, $e, $y];

guard $send + $more == $money, {
say "$send + $more == $money";

sub choose(Set $choices, &fn) {
    for @$choices -> $value {

sub guard($condition, &fn) {
    if $condition {

This takes about 26 minutes to run on my laptop. I despaired at this — the original Haskell version finishes in less than a second — but then I wrote an equivalent Perl 5 version, and it took 8 minutes. Paradoxically, that somehow made me feel less bad about Perl 6's performance. ("Wow, we're within an order of magnitude of Perl 5!")

(Update: Peter Sergeant sent me a faster Perl 5 version of the above script. His uses hashes instead of arrays. My Perl 6 port of this takes 15 minutes to run. That's two orders of magnitude slower — not cool.)


If you're new to Perl 6, you might not recognize (-) as set difference. I could also have used (U+2216 SET MINUS), but for once, the Texas version felt clearer.

I also like the clarity of $send = :10[$s, $e, $n, $d]. In the Perl 5 versions, I ended up with this helper sub that does the same.

sub base_10 {
    my (@digits) = @_;
    my $result = 0;
    while (@digits) {
        my $digit = shift @digits;
        $result *= 10;
        $result += $digit;
    return $result;

Perl 6 just treats it as a variant of the base conversion syntax.

Version B: iteration

Where the previous version tried to stick close to the original, this version just dumps all such concerns and tries to go fast. It does so by spewing out explicit loops, checks, and native integers. Among all the solutions, this one fails MJD's criteria the hardest... all in the name of speed.

my int $s = -1;
while ++$s <= 9 {
    next if $s == 0;

    my int $e = -1;
    while ++$e <= 9 {
        next if $e == $s;

        my int $n = -1;
        while ++$n <= 9 {
            next if $n == $s;
            next if $n == $e;

            my int $d = -1;
            while ++$d <= 9 {
                next if $d == $s;
                next if $d == $e;
                next if $d == $n;

                my int $send = $s*1000 + $e*100 + $n*10 + $d;

                my int $m = -1;
                while ++$m <= 9 {
                    next if $m == 0;
                    next if $m == $s;
                    next if $m == $e;
                    next if $m == $n;
                    next if $m == $d;

                    my int $o = -1;
                    while ++$o <= 9 {
                        next if $o == $s;
                        next if $o == $e;
                        next if $o == $n;
                        next if $o == $d;
                        next if $o == $m;

                        my int $r = -1;
                        while ++$r <= 9 {
                            next if $r == $s;
                            next if $r == $e;
                            next if $r == $n;
                            next if $r == $d;
                            next if $r == $m;
                            next if $r == $o;

                            my int $more = $m*1000 + $o*100 + $r*10 + $e;

                            my int $y = -1;
                            while ++$y <= 9 {
                                next if $y == $s;
                                next if $y == $e;
                                next if $y == $n;
                                next if $y == $d;
                                next if $y == $m;
                                next if $y == $o;
                                next if $y == $r;

                                my int $money =
                                    $m*10000 + $o*1000 + $n*100 + $e*10 + $y;
                                next unless $send + $more == $money;

                                say "$send + $more == $money";

(cygz++ for suggesting many improvements to the above code, which eventually led to the fast version we have now.)

This version takes 22 seconds on my laptop. Certainly an improvement over version A. The corresponding Perl 5 code (which doesn't do natives) takes 1.3 seconds. An NQP version takes 0.69 seconds (beating even Haskell), which leads me to believe we can still be a lot faster in Perl 6, too.

(Update: Apparently, if you produce Perl 5, Perl 6 and NQP versions of the same script, then you will be approached by japhb++ who will invite you to become part of a loosely-knit group of heroes known as the Benchmarker initiative. I added my scripts to the growing number of benchmark scripts. Exciting!)

(Update: Wohoo! timotimo++ made some commits to Rakudo, and suddenly this Perl 6 script takes but 15 seconds to run! That's like a 30% time saving!)

Version C: regex engine

Now for a version that tries to capitalize on the regex engine having backtracking behavior. The basic idea (using amb) comes from Rosetta Code. I'm a teeny bit disappointed amb has to resort to building regex fragments as strings, which feels inelegant.

sub amb($var, @a) {
    "[{ {"||\{ $var = '$_' }"}

sub infix:<except>(@lhs, @rhs) { (@lhs (-) @rhs).list }

my @digits = 0..9;

"" ~~ m/
    :my ($s, $e, $n, $d, $m, $o, $r, $y);
    :my ($send, $more, $money);

    <{ amb '$s', @digits except [0] }>
    <{ amb '$e', @digits except [$s] }>
    <{ amb '$n', @digits except [$s, $e] }>
    <{ amb '$d', @digits except [$s, $e, $n] }>
    { $send = :10[$s, $e, $n, $d] }
    <{ amb '$m', @digits except [0, $s, $e, $n, $d] }>
    <{ amb '$o', @digits except [$s, $e, $n, $d, $m] }>
    <{ amb '$r', @digits except [$s, $e, $n, $d, $m, $o] }>
    { $more = :10[$m, $o, $r, $e] }
    <{ amb '$y', @digits except [$s, $e, $n, $d, $m, $o, $r] }>
    { $money = :10[$m, $o, $n, $e, $y] }

    <?{ $send + $more == $money }>
    { say "$send + $more == $money" }

On the plus side, this algorithm nails the linear code layout and gets fairly close to being nice and clean. There's a bit of noise along the fringes, what with all the { } and <{ }> and <?{ }>, but for a Perl 6 regex, this is good going.

Too bad it's so damn slow. Extrapolating from a shorter run, I estimate that the program would take around 100 minutes to finish. But it gets killed off on my system after 88 minutes because it leaks ridiculous quantities of memory (11 MB a second, or 660 MB a minute). I wonder if I could submit that as a rakudobug.

(Update: At the expense of the nice syntactic abstraction offered by amb, I managed to produce a version of the regex that actually completes before it runs out of memory. (And doesn't leak nearly as bad.) Here it is. It runs in little over 6 minutes; worse than version B but better than version A.)

Version D: macros/speculation

Now, obviously, the solution that isn't burdened down by properly existing yet is also the cutest one.

use Hypothetical::Solver;

my @digits = 0..9;

solve {
    my $s = amb @digits (-) [0];
    my $e = amb @digits (-) [$s];
    my $n = amb @digits (-) [$s, $e];
    my $d = amb @digits (-) [$s, $e, $n];
    my $send = :10[$s, $e, $n, $d];
    my $m = amb @digits (-) [0, $s, $e, $n, $d];
    my $o = amb @digits (-) [$s, $e, $n, $d, $m];
    my $r = amb @digits (-) [$s, $e, $n, $d, $m, $o];
    my $more = :10[$m, $o, $r, $e];
    my $y = amb @digits (-) [$s, $e, $n, $d, $m, $o, $r];
    my $money = :10[$m, $o, $n, $e, $y];

    guard $send + $more == $money;
    say "$send + $more == $money";

Clearly, this won't even compile, as it's missing a dependency. Let's supply it with the smallest possible dependency, just honoring signatures:

module Hypothetical::Solver {
    sub solve(&block) is export {}
    sub amb($set) is export {}
    sub guard($condition) is export {}

Which... is useless, because now we have a program which looks pretty but does nothing.

So let's fix that. Here I have another program which eats the first program for breakfast. More exactly, it can parse the program and emit a new one that solves the problem. Be aware that the below is a bit of a hack (I'll get back to that), but at least each individual part is nice and self-contained.

grammar Solver::Syntax {
    token TOP { <statement>* }

    proto token statement {*}

    token statement:sym<use> {
        <sym> \s+ ([\w | '::']+) ';' \s*

    token statement:sym<my> {
        <sym> \s+ \S+ \s* '=' \s* <!before 'amb'> <-[;]>+ ';' \s*

    token statement:sym<solve> {
        <sym> \s+ ('{' \s*) <statement>* ('}' \s*)

    token statement:sym<guard> {
        <sym> \s+ (<-[;]>+ ';' \s*)

    token statement:sym<say> {
        <sym> \s+ <-[;]>+ ';' \s*

    token statement:amb-my {
        'my' \s+ (\S+) \s* '=' \s* 'amb' \s+ (<-[;]>+) ';' \s*

class Solver::Actions {
    method TOP($/) {
        make $<statement>».ast.join;

    method statement:sym<use>($/) {
        make $0 eq "Hypothetical::Solver" ?? "" !! ~$/;

    method statement:sym<my>($/) {
        make ~$/;

    method statement:sym<solve>($/) {
        make $0 ~ $<statement>».ast.join ~ $1;

    method statement:sym<guard>($/) {
        make "next unless " ~ $0;

    method statement:sym<say>($/) {
        make ~$/;

    method statement:amb-my ($/) {
        make "for ($1).list -> $0 \{\n" ~ $<statement>».ast.join.indent(4) ~ "\}\n";

(Entire script is here.)

The result is closest in spirit to version B above. But it doesn't try to be as optimized. As a result of this, it actually performs like version A, and finishes in 26 minutes.

Let me just conclude by making a few points.

Lately I've been nosing around languages that compile to JavaScript. Such languages allow us to state the program in a nicer, more fit-for-the-task language than JavaScript, but still get all the advantages of being able to run things in the browser.

The intended use of macros in Perl 6 is similar to this: express the problem in a "nicer way" (variant D), then massage it down to something that you could have written but would rather prefer not to (variant B). The big difference between macros and slangs (IMO) is that macros allow you to parse normally and then mess with the resulting Qtree, whereas slangs allow you to replace the parser with something else entirely (and then mess with the Qtree too, if required).

The fan on my laptop is relieved that I'm done running programs for this post. 哈哈

Here be heredocs

I used to consider Perl 6 heredocs a clear-cut symptom of second-system syndrome: taking a useful feature and weighing it down with extravagant bells and whistles until it cannot move. I read the specification for them and would think, leave well enough alone. Don't fix it if it ain't broken.

Since nowadays I've done a complete reversal on that opinion, and really love Perl 6's heredocs, I thought I would write my take on them.


The most noticeable part of Perl 6 heredocs as compared to Perl 5 ones is that Perl 6 heredocs can be indented.

In Perl 5, you'd do this:

for my $n (reverse 1..99) {
    my $n1 = $n - 1;
    my $n_s = $n == 1 ? "" : "s";
    my $n1_s = $n1 == 1 ? "" : "s";

    print <<"VERSE";
$n bottle$n_s of beer on the wall!
$n bottle$n_s of beer!
Take one down, pass it around,
$n1 bottle$n1_s of beer on the wall!


Heredocs could be said to be "anti-socially indented" compared to the rest of the program. If you quickly scan through a program, you'll see the general structure of it by how things are indented... plus a number of heredoc blocks of text completely ruining the picture.

I remember rationalizing this to myself. Thinking "oh well, heredocs are a bit special, they 'deserve' to stand out from the rest of the program the way they do". I no longer think that. In fact, I'd say the effect gets worse the bigger your application is. Bigger applications tend to rely more on nested blocks and indentation. So this is not likely to be a big problem for straightforward scripts with no control flow to speak of. But it is a problem as your application grows.

Here's how I would write the corresponding Perl 6 heredoc.

for reverse 1..99 -> $n {
    my $n1 = $n - 1;
    my $n_s = $n == 1 ?? "" !! "s";
    my $n1_s = $n1 == 1 ?? "" !! "s";

    say qq :to 'VERSE';
        $n bottle$n_s of beer on the wall!
        $n bottle$n_s of beer!
        Take one down, pass it around,
        $n1 bottle$n1_s of beer on the wall!

I'd say visually, that's a big improvement. S02 explains what's going on: "Leading whitespace equivalent to the indentation of the delimiter will be removed from all preceding lines."

I should note that even in Perl 5, you could conceivably do manual de-indenting. Something like this:

for my $n (reverse 1..99) {
    my $n1 = $n - 1;
    my $n_s = $n == 1 ? "" : "s";
    my $n1_s = $n1 == 1 ? "" : "s";

    print join "\n", map { substr $_, 8 } split /\n/, <<"VERSE";
        $n bottle$n_s of beer on the wall!
        $n bottle$n_s of beer!
        Take one down, pass it around,
        $n1 bottle$n1_s of beer on the wall!


But (a) that still leaves the terminator in an awkward position, and (b) doing it manually is extra code to get right and to maintain. (Of course, as nine++ pointed out on the channel, you can put the right amount of indentation into the terminator symbol. But, ick. I much prefer not having to do that.)

The .indent method

As a nice unintended side effect of implementing heredocs, we ended up with an .indent method on strings in core.

> say "foo".indent(4 * $_) for ^5;

The method works with a negative argument. In which case it (of course) removes indentation instead. If there's not enough to remove, it warns. (But it still gives you a sensible result.)

> say "Give up?\n  Never!".indent(12).indent(-4 * $_) for ^5;
            Give up?
        Give up?
    Give up?
Give up?
Asked to remove 16 spaces, but the shortest indent is 12 spaces  in block <unit> at <unknown file>:1

Give up?

As the final crowning touch, the method accepts a * (whatever) argument. Meaning, in this case, "(consistently) remove the biggest amount of indentation you can get away with". This is a nice default. Also, that's basically what heredocs end up doing, if for the purposes of de-indenting you consider the terminator to be part of the string.

The surface reason to add this method was that this was something heredocs needed to do internally anyway. But as it turns out, .indent is just a generally useful method to have around. It's possible to implement yourself (lines, map, join), but why bother? It's right there.

I'm happy about the way .indent turned out. It's even fairly sane in how it handles different kinds of whitespace — to the degree anything involving mixing tabs and spaces can really be referred to as "sane".

The heredoc terminator

Heredocs all work by setting up a terminator symbol. When the parser sees this symbol alone on a line later, it'll know that the heredoc ends. The terminator itself is not part of the heredoc string.

Here's how I write it:

say qq :to 'VERSE';
    $n bottle$n_s of beer on the wall!
    $n bottle$n_s of beer!
    Take one down, pass it around,
    $n1 bottle$n1_s of beer on the wall!

In the few example heredocs in S02 and S03, the spec chooses to write things together a bit more, and to use slashes around the terminator symbol:

say qq:to/VERSE/;
    $n bottle$n_s of beer on the wall!
    $n bottle$n_s of beer!
    Take one down, pass it around,
    $n1 bottle$n1_s of beer on the wall!

I think the choice of slashes here is unfortunate, because it makes it look like /VERSE/ is a regular expression literal. It isn't, it's just a string with funny delimiters. I don't know that I can stop the inevitable and prevent others from using slashes there, but myself, I'm going to try to use string quotes.

The exact choice of quotes doesn't determine whether the heredoc interpolates or not. Only the q or qq operator determines that. Which feels more sane anyway.

A word of warning if, like me, you decide to use single quotes around your terminator: you have to put in some whitespace between the to and the single quote. This is because to'VERSE is a valid identifier in Perl 6. That's why I put in the whitespace both before and after the :to. And now that it's there, I think I like it better. I might not always put it in, for example when the heredoc operator is part of a bigger expression and needs to be more of a visual pill in itself. But here, qq :to 'VERSE' looks nice and laid-back to me.

Or you could use qq:to<VERSE>, which also conveys "this is a string" and doesn't have the above apostrophe problem.

Indentation, revisited

Let me tell you a story that conveys quite well the Perl 6 maxim of "tormenting the implementors" (to benefit the users).

It's about this kind of code:

my $description = "not exactly Sparta,\nbut still nice";

say qq :to 'TEXT';
    Wow, this is $description!

Before July 2013, this used to warn about not-enough whitespace during de-intentation. Why? Because the $description string has two lines, and the second line does not have the required four spaces (or equivalent) of indentation that the terminator requires!

Yes, you read that right. Before the dust settled around exactly how to implement heredocs, you could get warnings because the interpolated strings in the heredoc were not properly indented. The heredoc itself would look fine in the code, but you'd still get the warning.

Arguably there are two "local optima" involved, though. Two possible ways in which we could view the process of interpolation/de-indentation. Let me lay them out for you:

  1. First, the heredoc string is finalized by interpolating all the variables into it. The resulting string is then de-indented.

  2. The heredoc is a sequence of constant strings separated by interpolations (either variables or expressions in {} blocks). The constant strings are de-indented, but the interpolations are left as-is.

The first model has fewer moving parts, and is easier to implement. The second model is easier to understand for the user, but more work for the implementor.

We ended up having the first model in Rakudo for a while, and I argued for the second model. Eventually TimToady settled the matter:

<TimToady> the intent is that heredoc indent is a textual feature, not a shortcut for a run-time feature
<TimToady> yes it's harder, but STD does it that way (and so niecza, I think)
<TimToady> it's what the user wants, not the implementor

In the end, timotimo++ implemented the second model, and all was well. You won't get de-indentation warnings from inside your interpolated variables.

...Furthermore, as a nice bonus, the constant string fragments can actually be de-indented at compile time! Because they're constant, and known at compile time. Under the former model we couldn't do that, since the entire string wasn't known until that point in the code at runtime (in the general case).

The limits of sanity

One final thing. One niggling little bit of discomfort remains.

You currently can't do this:

constant INTRO = q :to 'INTRO';
    Space: the final frontier.
    These are the voyages of the starship Enterprise.
    Its continuing mission: to explore strange new worlds,
    to seek out new life and new civilizations,
    to boldly go where no one has gone before.

A constant declaration gets evaluated and assigned to at parse-time, as soon as the parser sees the semicolon at the end of the declaration. And that's the problem, because at the point the parser hasn't yet seen the promised heredoc, and so it has nothing to assign to the constant.

The problem is perhaps a little easier to see if the constant declaration is re-written as a BEGIN block instead. BEGIN blocks also run ASAP, as the closing } is being parsed. This also doesn't work:

my $INTRO;
BEGIN { $INTRO = q:to/INTRO/; }
    Space: the final frontier.
    These are the voyages of the starship Enterprise.
    Its continuing mission: to explore strange new worlds,
    to seek out new life and new civilizations,
    to boldly go where no one has gone before.

I get that there are good reasons for disallowing the above two constructions. It's just that... I don't know, it feels slightly unfair. Heredocs are very nice and work well, constants are very nice and work well. If you combine them, the result ought to be twice as nice and also work well. But it isn't, and it doesn't.

In the case of de-indentation of interpolated variables, it was more of a clear-cut case of writing a bit more compiler code to DWIM things for the user. In this case... the stakes are higher. Because if the above were to work, we'd have to create an exception to one-pass parsing, something that Perl 6 values very highly.

<TimToady> masak: the fundamental problem with making the
           constant lookahead for the heredoc is that it
           violates the one-pass parsing rule
<masak> TimToady: yes, I realize that.
<TimToady> in fact, STD used to do the lookahead like P5
           does, and I rewrote it to avoid that :)
<TimToady> in fact, the discussion at S02:4474 stems from
           that time

In spite of all this, I remain hopeful. Maaaaaybe we can deviate ever so slightly from the one-pass parsing rule just to be a bit more DWIM-y to users who like both constants and heredocs. Maybe, just maybe, there's a clean way to do that. There's an open RT ticket that keeps hoping there is.

In the meantime, there's also a workaround. If I just put the semicolon after the heredoc, things work out.

constant INTRO = q :to 'INTRO'
    Space: the final frontier.
    These are the voyages of the starship Enterprise.
    Its continuing mission: to explore strange new worlds,
    to seek out new life and new civilizations,
    to boldly go where no one has gone before.

It's not ideal, but it will do in the interim.

Update 2015-04-11: Not four hours after I published my post, TimToady++ had constants with heredocs patched (cleanly) into Rakudo. He also updated S02. So I'm officially out of discomforts. 哈哈

Anyway, that was my story about heredocs. Here's to heredocs! 🍻