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
how to export alias to module function? #5995
Comments
From melezhik@gmail.comHI! Probably I I miss the syntax, but I am trying to make an alias for $ cat lib/Foo.pm6 unit module Foo; sub foo is export { say "hi there" } $ perl6 -Ilib -e 'use Foo; foo()' /// $ cat lib/Foo.pm6 unit module Foo; sub foo is export { say "hi there" } constant &foo-alias = &foo; perl6 -Ilib -e 'use Foo; Foo::foo-alias()' /// But last one does not compile: use v6; unit module Foo; sub foo is export { say "hi there" } constant &foo-alias is export = &foo; $ perl6 -c lib/Foo.pm6 Regards. Alexey |
From @LLFournLooks like a bug to me. Seems to be it bugs out if you put "is export" on a You could do this until it's fixed: sub foo is export { } On Tue, Jan 10, 2017 at 1:21 AM Alexey Melezhik < # New Ticket Created by Alexey Melezhik HI! Probably I I miss the syntax, but I am trying to make an alias for $ cat lib/Foo.pm6 unit module Foo; sub foo is export { say "hi there" } $ perl6 -Ilib -e 'use Foo; foo()' /// $ cat lib/Foo.pm6 unit module Foo; sub foo is export { say "hi there" } constant &foo-alias = &foo; perl6 -Ilib -e 'use Foo; Foo::foo-alias()' /// But last one does not compile: use v6; unit module Foo; sub foo is export { say "hi there" } constant &foo-alias is export = &foo; $ perl6 -c lib/Foo.pm6 Regards. Alexey |
The RT System itself - Status changed from 'new' to 'open' |
From melezhik@gmail.comHi Lloyd!
Exactly. Meanwhile I just do something like this: sub foo-alias is export { foo } This works for me two. I will be waiting till bug is fixed so to rely 2017-01-10 14:35 GMT+03:00 Lloyd Fournier via RT <perl6-bugs-followup@perl.org>:
|
Migrated from rt.perl.org#130533 (status was 'open')
Searchable as RT130533$
The text was updated successfully, but these errors were encountered: