Carl Mäsak wrote:
> * It is my feeling that such encapsulation-breakage shouldn't be
> allowed. Do you agree, p6l?

Time may proof me wrong, but I think it's not such a big issue.

Note that encapsulation can be broken in many ways already, wither with
MONKEY_TYPING or by using introspection techniques (which aren't fully
specced yet, but they *will* exist. In case of doubt you can just parse
.perl output).

> * If it isn't allowed, which of the two steps is disallowed?
> *Detaching* a method containing references to private accessor slots
> (thereby extending the syntactic restriction of "no private accessors
> outside of the class block"), or *attaching* an anonymous method to an
> object belonging to a different class than the one from which it was
> detached (thereby by necessity having to complicate anonymous methods
> somewhat)?

There's a third possiblity - $!foo being bound to the $!foo attribute of
the lexically enclosing class at compile-time. So that re-attaching
methods make them still refer to the old attribute. Not sure if it's a
good idea, just food for thought.

Moritz Lenz | |

Reply via email to