Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Module/Class definition in Rakudo

by Burak (Chaplain)
on Dec 06, 2009 at 01:01 UTC ( [id://811292]=perlquestion: print w/replies, xml ) Need Help??

Burak has asked for the wisdom of the Perl Monks concerning the following question:

I've been playing with rakudo recenly and did a little investigation about module definitions. The only module repository is the pugs repo AFAIK. I've cloned it to see some code. However class/module definitions with versions does not seem to work. Does Rakudo not support ( no such mention in http://rakudo.org/status ) that syntax yet or the syntax changed perhaps (since pugs is no longer alive)?
C:\>perl6 -e "module Foo;" C:\>perl6 -e "module Foo-1.0;" Unable to parse module definition at line 1, near "-1.0;" in Main (file src\gen_setting.pm, line 1559) C:\>perl6 -e "class Foo;" C:\>perl6 -e "class Foo-1.0;" Unable to parse class definition at line 1, near "-1.0;" in Main (file src\gen_setting.pm, line 1559) C:\>
note: I have rakudo#23

Replies are listed 'Best First'.
Re: Module/Class definition in Rakudo
by moritz (Cardinal) on Dec 06, 2009 at 22:27 UTC

    The syntax you use is wrong (see S11 for example), the right thing would be

    module Foo:ver<1.0>;

    Rakudo (latest version from github) seems to accept this syntax, but to the best of my knowledge ignores it.

    Perl 6 - links to (nearly) everything that is Perl 6.
      Thanks! #23 seems to parse that as well since I get no errors :) So, the sample modules in the pugs repo are not quite good examples I presume?
        Many of those are very outdated. You'll have better chances in the perl6-examples repository on github.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://811292]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found