Just a quick thought that occurred to me as I was reading
Moose::Unsweetened...  I hope the API isn't set in stone yet...  If the
accessors presented there are correct, then the accessor functionality
might be slightly more efficient from a caller's perspective if the
"old" (also "current", with no arg) value was always returned.  Then,
something like the following could be useful:

        my $old = $user->email_address($new);

Whereas now, the above call would return $new, which is already known by
the caller and therefore not useful.

The new accessor would look something like this:

sub email_address {
    my $self = shift;
    my $v = $self->{email_address};

    if (@_) {
        $self->_validate_email_address( $_[0] );
        $self->{email_address} = $_[0];
    }

    return $v;
}

Regards,

Derek
-- 
Derek R. Price
Solutions Architect
Ximbiot, LLC <http://ximbiot.com>
Get CVS and Subversion Support from Ximbiot!

v: +1 248.835.1260
f: +1 248.835.1263

Reply via email to