Brandon Allbery allbery-at-kf8nh.com |Perl 6| wrote:
S06/Lvalue subroutines: "Lvalue subroutines return a proxy object
that can be assigned to. (...)"
S13/Methods: "Setter methods that expect the new value as an argument
do not fall into the well-behaved category, however."
When I take these two together, in a way which may be out of context
for the second but is a fairly obvious interpretation, I get as strong
sense of hubris. Setter methods that take arguments are considered
bad, but the alternative is horrible ugliness involving explicitly
creating and returning proxy arguments??? Anyone who's used Ruby will
point to `def foo=' and laugh at you; everyone else will use
traditional setters and ignore the whole `is rw' thing as overweening
nonsense.
I hope I'm misunderstanding this....
I have similar thoughts. I'm thinking that some macros will aid in
writing proper setters via a tie-like mechanism that don't require any
core language changes, so it's not a real problem. That is, a reusable
proxy class that you can construct to run the setter body code, and
package it up so you write it like a method.
--John