Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] [sympa-commits] sympa[8261] branches/sympa-6.2-branch/src/lib: [dev] split AUTOLOAD of Site to Site and Robot,

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] [sympa-commits] sympa[8261] branches/sympa-6.2-branch/src/lib: [dev] split AUTOLOAD of Site to Site and Robot,
  • Date: Tue, 18 Dec 2012 15:35:00 +0100


Le 18/12/12 14:50, Guillaume Rousse a écrit :
Le 18/12/2012 14:35, David Verdin a écrit :
I'm also quite found of the getters / setters. But we have to deal with
legacy. What Soji proposes is a good compromise for the 6.2 version. It
gives us accessors without having to rewrite large parts of the code.
However, using get_* and set_* methods implemented looks like a good aim
for 6.3 on my opinion.
Turning those automatically-generated 'foo()' accessors into 'get_foo()' is just a matter or changing the regexp used to parse AUTOLOAD value:

$AUTOLOAD =~ m/^(.*)::(.*)/;
to
$AUTOLOAD =~ m/^(.*)::get_(.*)/;

The same statement, with a stricter regexp and error handling:
croak "no such method" unless $AUTOLOAD =~ m/^(\S+)::get_(\S+)/;
Croak again, darn... ;-)

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page