Damian Conway wrote:
>
> > Now, if this is what you want, add a :readonly attribute:
>
> So the proposal is: make the dangerous one the default.
> I don't think that's a good idea.
You're going to have to explain to me how these differ in their
dangerousness:
$r->func = $x; # this more dangerous
$r->func($x); # than this somehow?
I know that the current implementation of :lvalue subs is broken.
However, if this is fixed and $x is just a regular argument (so that the
two examples above are equivalent in every way), then it seems there is
no difference.
Isn't that the goal of the RFC? To fix lvalue subs so they work just
like regular subs? That's what I read it as:
> It is proposed that lvalue subs should be called with the rvalue
> passed as a regular argument. Thus,
>
> $p->name = 'Mithrandir';
>
> would be directly equivalent to
>
> $p->name('Mithrandir');
Note the part that says "directly equivalent".
If the two are really made equivalent there can't be any difference
between them by definition. At that point I think :lvalue should go
away, since it would be superfluous.
Does what I'm getting at make sense?
Now whether :readonly or :constant or some other modifier, which adds a
different meaning here (inability to pass in @_), is added is probably a
separate issue.
-Nate