Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Named rules and basic OO support landed.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Autrijus Tang  
View profile  
 More options May 10 2005, 8:48 pm
Newsgroups: perl.perl6.compiler
From: autri...@autrijus.org (Autrijus Tang)
Date: Wed, 11 May 2005 08:48:08 +0800
Local: Tues, May 10 2005 8:48 pm
Subject: Named rules and basic OO support landed.

This works:

    rule name { Larry | Matz | Guido }
    rule project { Perl | Ruby | Python }
    rule description { <name> \s does \s <project> }

    'Larry does Perl' ~~ /<description>/;   # true
    'Larry does Java' ~~ /<description>/;   # false

This too:

    class Point {
        has $.x;
        has $.y;
        method show () { say "Coordinate: ($.x, $.y)" }
        method set ($x, $y) { $.x = $x; $.y = $y }
    }

    my $pt = Point.new(:x(10), :y(20));
    $pt.show;   # Coordinate: (10, 20)

    my $pt2 = $pt.clone;
    $pt.set(30, 40);
    $pt.show;   # Coordinate: (30, 40)
    $pt2.show;  # Coordinate: (10, 20)

    say(($pt ~~ Point).perl);   # bool:true
    say(($pt ~~ Hash).perl);    # bool::false

Pugs's Parrot codegen backend needs to be updated to reflect both of
them, but the basics are there.  May the hackings commence. :)

Thanks,
/Autrijus/

  application_pgp-signature_part
< 1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Darren Duncan  
View profile  
 More options May 11 2005, 3:07 am
Newsgroups: perl.perl6.compiler
From: dar...@DarrenDuncan.net (Darren Duncan)
Date: Wed, 11 May 2005 00:07:41 -0700
Local: Wed, May 11 2005 3:07 am
Subject: Re: Named rules and basic OO support landed.
Sweet candy!  I might actually be able to start executing some of my
code!  Will try any day now. -- Darren Duncan

At 8:48 AM +0800 5/11/05, Autrijus Tang wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google