# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #123083]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123083 >


<masak> m: enum :: <un>; say ~un
<camelia> rakudo-moar 315ec6: OUTPUT«un␤»
<masak> m: enum :: <un>; say +un
<camelia> rakudo-moar 315ec6: OUTPUT«0␤»
<masak> nul! :)
<FROGGS> m: anon enum <un>; say +un
<camelia> rakudo-moar 315ec6: OUTPUT«[31m===[0mSORRY![31m===[0m Error
while compiling /tmp/4SVYtYZqUD Undeclared routine:     un used at
line 1 [...]
<FROGGS> m: anon enum <un>;
<camelia> rakudo-moar 315ec6: ( no output )
<FROGGS> weird
<masak> FROGGS: you can't use that syntax, and for good reason.
<masak> FROGGS: `enum` is a declarator, and expects a declaratee as a
first "argument".
<masak> I should really find better terminaology for this stuff.
<FROGGS> std: anon enum <un>;
<camelia> std 14ad63b: OUTPUT«ok 00:00 136m␤»
<masak> std: enum <un>
<camelia> std 14ad63b: OUTPUT«ok 00:00 136m␤»
<masak> I posit that STD is full of it.
<masak> oh wait. no.
<masak> S12 actually mentions this kind of declarations.
<FROGGS> masak: to me both versions are identical in their meaning
<FROGGS> like  anon sub { }  vs.  sub :: { }
<masak> m: my %e = enum < ook! ook. ook? >;  # should work, according to S12
<camelia> rakudo-moar 315ec6: ( no output )
<masak> m: my %e = enum < ook! ook. ook? >; say %e.perl
<camelia> rakudo-moar 315ec6: OUTPUT«("ook." => 1, "ook!" => 0, "ook?"
=> 2).hash␤»
<masak> ok, seems to work.
<FROGGS> m: my %e = anon enum < ook! ook. ook? >; say %e.perl
<camelia> rakudo-moar 315ec6: OUTPUT«("ook!" => 0, "ook?" => 2, "ook."
=> 1).hash␤»
<FROGGS> m: my %e = enum :: < ook! ook. ook? >; say %e.perl
<camelia> rakudo-moar 315ec6: OUTPUT«Odd number of elements found
where hash initializer expected␤  in method STORE at
src/gen/m-CORE.setting:10116␤  in block <unit> at /tmp/pYuofjsJWX:1␤␤»
<FROGGS> dang
<masak> there's gotta be something rakudobuggable in all of this.
<FROGGS> yes, `anon enum <un>;` should do what `enum :: <un>;` does
(and not silently do nothing), and `my %e = enum :: < foo bar baz >`
should work too
* masak submits rakudobug for that
<masak> FROGGS++ # auxiliary brain

Reply via email to