FAQ
1: Does Perl 6 has method modifiers like those in Moose? Where can I get the doc about that? By reading apocalypse?
2: Does Perl 6 has build-in support for message passing (like those in Glib and Actionscript)?
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

Search Discussions

  • Moritz Lenz at Jun 20, 2010 at 10:18 am
    Hi,

    Xi Yang wrote:
    1: Does Perl 6 has method modifiers like those in Moose?
    Perl 6 has traits, so you can write for example

    class A {
    method x() is rw { ...}
    }

    to indicate that it's an lvalue routine (though I don't think it's
    implemented in Rakudo yet).
    Where can I get the doc about that? By reading apocalypse?
    The Apocalypses are of historical interest only. Please read the
    Synopsis instead

    http://perlcabal.org/syn/
    http://perlcabal.org/syn/S06.html
    http://perlcabal.org/syn/S12.html

    2: Does Perl 6 has build-in support for message passing (like those in Glib and Actionscript)?
    I fear I'm not qualified to answer that, and I hope somebody else picks
    up the topic.

    Cheers,
    Moritz
  • Xi Yang at Jun 20, 2010 at 11:46 am
    You might mis-understood method modifiers. I mean:
    before x()
    after x()
    around x()
    ....
    Date: Sun, 20 Jun 2010 12:17:46 +0200
    From: moritz@faui2k3.org
    To: jiandingzhe@msn.com
    CC: perl6-users@perl.org
    Subject: Re: Two questions on Perl 6 functionality

    Hi,

    Xi Yang wrote:
    1: Does Perl 6 has method modifiers like those in Moose?
    Perl 6 has traits, so you can write for example

    class A {
    method x() is rw { ...}
    }

    to indicate that it's an lvalue routine (though I don't think it's
    implemented in Rakudo yet).
    Where can I get the doc about that? By reading apocalypse?
    The Apocalypses are of historical interest only. Please read the
    Synopsis instead

    http://perlcabal.org/syn/
    http://perlcabal.org/syn/S06.html
    http://perlcabal.org/syn/S12.html

    2: Does Perl 6 has build-in support for message passing (like those in Glib and Actionscript)?
    I fear I'm not qualified to answer that, and I hope somebody else picks
    up the topic.

    Cheers,
    Moritz
    _________________________________________________________________
    Hotmail: Free, trusted and rich email service.
    https://signup.live.com/signup.aspx?id=60969
  • Moritz Lenz at Jun 20, 2010 at 11:54 am

    Xi Yang wrote:
    You might mis-understood method modifiers. I mean:
    before x()
    after x()
    around x()
    ....
    In Perl 6, you do that with wrapping:

    http://perlcabal.org/syn/S06.html#Wrapping


    Cheers,
    Moritz
  • Xi Yang at Jun 21, 2010 at 4:55 am
    Very subtle implementation, I'm trying to understand those things. Thanks!
    Date: Sun, 20 Jun 2010 13:53:59 +0200
    From: moritz@faui2k3.org
    To: jiandingzhe@msn.com
    CC: perl6-users@perl.org
    Subject: Re: Two questions on Perl 6 functionality



    Xi Yang wrote:
    You might mis-understood method modifiers. I mean:
    before x()
    after x()
    around x()
    ....
    In Perl 6, you do that with wrapping:

    http://perlcabal.org/syn/S06.html#Wrapping


    Cheers,
    Moritz
    _________________________________________________________________
    Hotmail: Free, trusted and rich email service.
    https://signup.live.com/signup.aspx?id=60969
  • Timothy S. Nelson at Jun 30, 2010 at 7:04 am

    On Sun, 20 Jun 2010, Xi Yang wrote:
    You might mis-understood method modifiers. I mean:
    before x()
    after x()
    around x()
    .....
    Just a note that I've usually seen this called "Aspect-Oriented
    Programming".
    2: Does Perl 6 has build-in support for message passing (like those in Glib and Actionscript)?
    I fear I'm not qualified to answer that, and I hope somebody else picks
    up the topic.
    I'm even less qualified, but I have this feeling that the whole thing
    is tied up in the event/threading side of things. But I don't actually know
    anything.

    Xi, basically, the specification for Events and Threading is still
    very much in its draft stages:

    http://perlcabal.org/syn/S17.html

    You can see that it mentions an Event Loop, but there's no information
    about it yet. So assuming that I'm correct, the best answer we can give you
    is "The plans for that part of Perl 6 are still on the drawing board".

    HTH,

    :)


    ---------------------------------------------------------------------
    Name: Tim Nelson | Because the Creator is, |
    E-mail: wayland@wayland.id.au | I am |
    ---------------------------------------------------------------------

    ----BEGIN GEEK CODE BLOCK----
    Version 3.12
    GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
    PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
    -----END GEEK CODE BLOCK-----
  • Xi Yang at Jun 21, 2010 at 6:32 am
    I still have several points unclear, this is my sample:
    ###################################
    class Base {
    method toHash() {
    return {};
    }
    }
    role FooBar {
    has $.foo is rw;
    has $.bar is rw;
    toHash.wrap({
    my $hash = callsame();
    $hash<foo> = $self.foo;
    return $hash;
    });
    }
    class Compose is Base does FooBar {
    }
    my $obj = Compose.new(foo=>'foovalue', bar=>'barvalue');
    my $data = $obj->toHash;###################################
    1: It tells me "toHash" is not defined, as the role actually don't has that.
    2: It seems that wrapping will affect the closure globally, but I only want class with specific role has specific modification.
    Date: Sun, 20 Jun 2010 13:53:59 +0200
    From: moritz@faui2k3.org
    To: jiandingzhe@msn.com
    CC: perl6-users@perl.org
    Subject: Re: Two questions on Perl 6 functionality



    Xi Yang wrote:
    You might mis-understood method modifiers. I mean:
    before x()
    after x()
    around x()
    ....
    In Perl 6, you do that with wrapping:

    http://perlcabal.org/syn/S06.html#Wrapping


    Cheers,
    Moritz


    _________________________________________________________________
    Hotmail: Powerful Free email with security by Microsoft.
    https://signup.live.com/signup.aspx?id=60969

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-users @
categoriesperl
postedJun 20, '10 at 5:06a
activeJun 30, '10 at 7:04a
posts7
users3
websiteperl6.org

People

Translate

site design / logo © 2021 Grokbase