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

Default invocant of methods

Thread Next
From:
Ingo Blechschmidt
Date:
May 27, 2005 14:02
Subject:
Default invocant of methods
Message ID:
d781ja$lom$1@sea.gmane.org
Hi,

what is the default invocant of methods?

  method blarb ($normal_param) {...}
  # Same as
  method blarb (Class | ::?CLASS $invocant: $normal_param) {...}
  # or
  method blarb (::?CLASS $invocant: $normal_param) {...}
  # ?

I prefer the latter, as then one can't accidentally call a instance
method on the class -- i.e.
  Foo.blarb   # will die.

You can always specify Class as invocant, if you want to have a class
method.

Opinions?


--Ingo

-- 
Linux, the choice of a GNU | Elliptic paraboloids for sale.  
generation on a dual AMD   | 
Athlon!                    |


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