Wouldn't it be nice to be able to supply default values for instance
variables right in the attribute declaration?

     class Jabberwock {
         has $.jaws  = "bite";
         has $.claws = "catch";
     }

     my $scary = Jabberwock.new;
     my $wimpy = Jabberwock.new(jaws => "chew", claws => "tenderly comb");

S<12/Roles/"Roles may have attributes"> implies that this kind of thing is
okay in roles. Is there any reason not to allow it as in the above too?
This replaces the need for an explicit BUILD in many cases, which I
think is useful.

-- 
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/

Reply via email to