develooper Front page | perl.perl6.language | Postings from August 2005

Reassigning .ref and .meta? Rebinding class objects?

Thread Next
From:
Ingo Blechschmidt
Date:
August 5, 2005 05:16
Subject:
Reassigning .ref and .meta? Rebinding class objects?
Hi,

    my $str   = "Hello";
    $str.ref  = Int;              # allowed?
    $str.meta = &some_sub.meta;   # allowed?


    my $str   = "Hello";
    Str     ::= Int;              # allowed?
    ::Str   ::= ::Int;            # or is this allowed?
    say $str;                     # still "Hello"? Or is it an Int now?

    my $new_str = "Hi";
    say $new_str;                 # is this an Int now?


    Str     ::= "simple string";  # not allowed?
    ::Str   ::= "simple string";  # not allowed?


--Ingo

-- 
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD   | stream...  
Athlon!                    |


Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About