develooper Front page | perl.perl5.porters | Postings from February 2009

Re: method names clash by importing: next step

Thread Previous | Thread Next
From:
Dmitry Karasik
Date:
February 26, 2009 00:12
Subject:
Re: method names clash by importing: next step
Message ID:
84ab89liqx.fsf@tetsuo.karasik.eu.org
	Hi chromatic!

On 26 фев 09 at 00:26, "chromatic" (chromatic ) wrote:

 chromatic> On Wednesday 25 February 2009 11:44:28 Dmitry Karasik wrote:
 >> OTOH my approach, if it becomes default, suffers from cases where one
 >> deliberately wants to import methods, as you pointed with mixins, and
 >> as Stevan Little pointed on perlmonks: he imports
 >> Scalar::Utils::blessed for $obj->blessed magic. I can't say that my
 >> approach doesn't bring trouble here (except of course if it is off by
 >> default, but then again, that becomes too complex).

 chromatic> With regard to &Scalar::Utils::blessed, I can imagine some sort
 chromatic> of mechanism by which you add a function to a class as a
 chromatic> method.  Parrot, for example, has an "add method" operation on
 chromatic> classes.

Based on Graham Barr's proposal, I think either

   use methods qw(blessed);

or

   use methods qw(:mixin)

should be the equivalent of "add method" here.

--
Sincerely,
	Dmitry Karasik


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