> On 4/19/04 3:58 PM, Austin Hastings wrote:
 
> One work-around might be an alternate kind of default accessor that doesn't
> allow assignment:
> 
>     $dog.name         # get
>     $dog.name('foo')  # set
>     $dog.name = 'foo' # compile-time error

I think we already have this.  Just define a non-rw attribute and then
add your own writer as a multi-method.

      has Str $.name;
      multi method name(Str $n) {$.name = $n;}

--
Mark Biggar
[EMAIL PROTECTED]

Reply via email to