OK x not xx.
The doubling of operators is confusing.
On 12/19/2013 10:01 PM, Jonathan Worthington wrote:
On 12/19/2013 3:47, Richard Hainsworth wrote:
Are you sure you didn't want the x (string repetition) operator,
instead of xx (list repetition)?
Initially I though the following was a bug, but now I'm not sure.
I got these results
This is perl6 version 2013.09 built on parrot 5.5.0 revision 0
> say '0' xx 4
0 0 0 0
> print '0' xx 4
0000> print 's' ~ ('0' xx 4)
s0 0 0 0>
I'm not sure why the elements of the expansion are padded with a
trailing space in one context but not in another.
print calls .Str, say calls .gist.
I wasn't sure whether this is the specified behaviour.
If it is how can it be turned off?
Call .Str or .gist on the argument to print/say as needed.
I suspect that the problem will be resolved by using the x operator
instead of xx, however. :-)