develooper Front page | perl.perl6.language | Postings from April 2002

Re: Unary dot

Thread Previous | Thread Next
From:
Damian Conway
Date:
April 7, 2002 18:08
Subject:
Re: Unary dot
Message ID:
3CB0ED4F.6E2F31A6@conway.org
Piers asked:

> So, is there any chance that we'll be able to do:
> 
>   class ical {
>     use object_name '$self';
> 
>     method ical {
>       given $self.ology {
>         ... { $self.ish }
>       }
>     }
>   }

Of course, if you're not using explicit parameters, you can always write:

      method ical {
        given @_[0].ology {
          ... { @_[0].ish }
        }
      }


It would be nice to have a cleaner way to do that, though.
So I'd like to see something like your pragma. However, I'd 
probably make it more like:

     use invocant 'self';

      method ical {
        given self.ology {
          ... { self.ish }
        }
      }

and then probably use:

	use invocant 'me';

to save those two extra characters!

;-)

Damian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About