>       my Date $date .= new('June 25, 2002');

If we're assuming that C<my Date $date> creates an C<undef but isa(Date)>
object, then that object should be able to overload its assignment operator.
I don't know what the perl6 syntax will be, but something along the lines of

class Date
{
  method operator= ($value is rx/<std_date>/)
  {
     unless (defined $self)
     {
         $self = .new()
     }

     $.year = $value{year};
     $.month = $value{month};
     # etc.
  }
};

should cover it, assuming it is "valid" style for a variable to act as a
value rather than an object-reference.


Dave.

Reply via email to