That's a requirement that would mean a new feature. Something like:
# Perl: sub set_area_to { my $self = shift; my ($area) = @_; $self->{radius} = sqrt( $area / $PI ); return; } # Ruby def area= (new_area) @radius = Math.sqrt( new_area / @@PI ) end # Note, this means that the Ruby version allows for: # circle.area = 22 # And it will DWIM
I fail to see the problem.
In reply to Re^3: The Accessor Heresy
by dragonchild
in thread The Accessor Heresy
by Roy Johnson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |