Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anon enum should work the same way as enum ::, and my %e = enum :: should work too in Rakudo #3570

Closed
p6rt opened this issue Oct 29, 2014 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 29, 2014

Migrated from rt.perl.org#123083 (status was 'resolved')

Searchable as RT123083$

@p6rt
Copy link
Author

p6rt commented Oct 29, 2014

From @masak

<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

@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Patch​: rakudo/rakudo@8f4e908869
Test​: Raku/roast@f47d1dab1b

Closing ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Patch​: rakudo/rakudo@8f4e908869
Test​: Raku/roast@f47d1dab1b

Closing ticket.

@p6rt p6rt closed this as completed Oct 10, 2015
@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

@FROGGS - Status changed from 'new' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Two more tests​: Raku/roast@51332a9ae1

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant