develooper Front page | perl.perl6.compiler | Postings from October 2011

[perl #67858] [BUG] Enums have postcircumfix:<[ ]> capability, but give a less than awesome error message when they're used in Rakudo

Thread Next
From:
Will Coleda via RT
Date:
October 14, 2011 12:25
Subject:
[perl #67858] [BUG] Enums have postcircumfix:<[ ]> capability, but give a less than awesome error message when they're used in Rakudo
Message ID:
rt-3.6.HEAD-31297-1318620312-834.67858-15-0@perl.org
On Fri Jul 24 10:29:44 2009, masak wrote:
> * masak realizes he can use introspection to find even weirder bugs
> <masak> rakudo: enum foo <>; say foo[1]

This syntax is no longer accepted:

15:23 < [Coke]> rakudo: enum foo <>; say foo[1]
15:23 <+p6eval> rakudo ce15be: OUTPUT«===SORRY!===␤Unsupported use of 
<>; in
                Perl 6 please use lines() to read input, ('') to 
represent a
                null string or () to represent an empty list at line 1, 
near
                "<>; say fo"␤»


Can you rewrite the code to show the problem or show it's closable? 
Thanks.

> <p6eval> rakudo d4d231: OUTPUT«No applicable candidates found to
> dispatch to for '!create_simple_role_helper' [...]
> * masak submits rakudobug
> <jnthn> Guess same as
> <jnthn> rakudo: role Foo { }; Foo[42]
> <p6eval> rakudo d4d231: OUTPUT«No applicable candidates found to
> dispatch to for '_block50' [...]
> <jnthn> Aye
> <jnthn> Need better error.
> <masak> except that enums declare themselves as having a 
postcircumfix:[ ]
> <jnthn> Oh?
> <masak> rakudo: enum foo <>; say foo.^methods>>.name.grep(/post/).perl
> <p6eval> rakudo d4d231: OUTPUT«["postcircumfix:[ ]"]␤»
> <jnthn> Exactly.
> <jnthn> And on a role, that is a selector.
> <jnthn> Think class Foo does Answer[42] { }
> <masak> oh.


-- 
Will "Coke" Coleda

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About