On Fri, 08 Dec 2017 08:28:32 -0800, comdog wrote:
> This comes from an answer to a Perl 6 question on Stackoverflow that
> showed a different bug:
>
> https://stackoverflow.com/q/45527881/2766176
>
> With put() it does not and gives a strange error:
I guess jnthn++ gets a score point for predicting[^1] this would happen:
<jnthn> Hmmm...not too keen on the Junction.Str patch
<jnthn> Anything that (quite reasonably) does nqp::unbox_s($foo.Str) is now
going to (quite rightly) explode
<timotimo> clearly we have to build UNBOXABLE_STR :)
<jnthn> No, it can just explode, and then I'll point people at this commit.
:P
If put() were made to work here, I'd expect it to junct and be equivalent to
`put 1`, `put 3`, `put 7` executed in random order, but the OP in that SO has
an entirely different expectation.
> I'd expect anything that can .gist would be able to .Str.
Side note on that: only the opposite is true. A basic class would .gist to its
name, while its .Str would be an empty string accompanied by a warning. Also,
some things, like self-referential structures or non-lazy infinite iterables,
would take an infinite time to .Str, while getting .gisted is no trouble.
[1] https://irclog.perlgeek.de/perl6-dev/2017-08-09#i_14992203