Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Named rules and basic OO support landed.
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.

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