in reply to Perl 6 class

It seems that the is rw trait on a class is interpreted as is $classname (which means inheritance), and actually I'm not sure if the is rw trait on a class is even in the specs (Update: it's an example in the spec, but I'm not sure what it means).

Try it without the first is rw instead. The ones on the attributes should be fine.

Replies are listed 'Best First'.
Re^2: Perl 6 class
by Stanislav (Novice) on Nov 18, 2008 at 16:00 UTC
    Thanks moritz for the reply. I've already tried without 'is rw' and it works, and also I saw a spec. But, the question is why I see the same example in spec:
    Class traits are set using is: class MyStruct is rw {...}
    and also see the same construction in wiki and it isn't work. You wrote:
    (Update: it's an example in the spec, but I'm not sure what it means)
    I think it means (from the spec):
    If you declare the class as rw, then all the class's attributes default to rw, much like a C struct.
      Stanislav,
      I am not sure moritz's answer explained things completely. If you understood great. If not (for those following along at home), here is more of the story. Unlike perl 5, perl 6 will not be specification by implementation. It has an independent specification and any implementation that passes the perl 6 test suite will be consider perl 6. While the perl 6 specification is still changing (very slowly - more fine tuning at this point), there are a number of implementations that are in various stages of completion. The Rakudo (perl 6 on parrot) implementation is not yet meeting the spec in this regard. That's the simple answer.

      See Getting Involved with Perl 6 - an Update for more information.

      Cheers - L~R

      I've opened a ticket (perl 60636) for that, but I don't think it's high priority at the moment so it might take some time to get fixed (though patches are always welcome, and Patrick, Jonathan, Masak and I always try to review and apply them quickly).
        Thanks Moritz. Sorry, I'm not familiar with PIR, but when I'll have a free time I'll investigate in this direction.