On Sat, 26 Nov 2016 15:47:38 -0800, comdog wrote:
> Adapted from the Stackoverflow answer at:
> http://stackoverflow.com/a/40824226/2766176
> 
> I'm using moar (2016.10) on macosx (10.10.5) darwin (14.5.0) (These
> variables are quite nice!)
> 
> This came out of a problem I had with set membership. It turns out
> that the way you make the set matters, and the way you make the
> candidate member matters. In my case, there's a bug with angle-bracket
> word quoting.
> 
> I used the [angle-brackets form of the quote
> words](https://docs.perl6.org/language/quoting#Word_quoting:_qw). The
> quote words form is supposed to be equivalent to the quoting version
> (that is, True under `eqv`). Here's the doc example:
> 
>     <a b c> eqv ('a', 'b', 'c')
> 
> But, when I try this with a word that is all digits, this is not equivalent:
> 
> $ perl6
> > < a b 137 > eqv ( 'a', 'b', '137' )
> False
> 
> But, the other forms of word quoting are!
> 
> > qw/ a b 137 / eqv ( 'a', 'b', '137' )
> True
> > Q:w/ a b 137 / eqv ( 'a', 'b', '137' )
> True
> 
> The angle-bracket word quoting uses
> [IntStr](https://docs.perl6.org/type/IntStr):
> 
> > my @n = < a b 137 >
> [a b 137]
> > @n.perl
> ["a", "b", IntStr.new(137, "137")]
> 
> Without the word quoting, the digits word comes out as [Str]:
> 
> > ( 'a', 'b', '137' ).perl
> ("a", "b", "137")
> > ( 'a', 'b', '137' )[*-1].perl
> "137"
> > ( 'a', 'b', '137' )[*-1].WHAT
> (Str)
> > my @n = ( 'a', 'b', '137' );
> [a b 137]
> > @n[*-1].WHAT
> (Str)


Thanks for the reqport, however, what you describe is not a bug, as the angle 
brackets
have special feature to construct IntStr, NumStr, RatStr, and ComplexStr 
allomorphs as
well as specify Rat and Complex literals.

The documention was just misleading. I corrected it in:
https://github.com/perl6/doc/commit/fa0b8f643356a3db1e5e59fda4f153f48f90ee90

Reply via email to