Moritz wrote:

> To re-iterate, Perl 6 has no "real" privacy by default -- both the
> default .new and .perl methods give you access to private attributes,
> unless you explicitly override them.

At least you *can* explicitly override them (and perhaps factor that out
into a role that you could always use). But even then, I suppose, that's
still all to easy to bypass, with a fully qualified call, if the core
.perl stays
broken. :-(

> I would be fine with changing get_value and set_value method names to all
> uppercase, as an additional warning sign, if that would comfort you in some
> way.

Thank-you, but no. Shouting doesn't really solve my problem.

I'm looking for a consistent way to identify dangerous code. And we
already have that, in the form of C<use MONKEY_TYPING;>. What would
comfort me would be if objects and classes could actually be relied upon
to be properly encapsulated and stable, unless someone explicitly
declares they are monkeying.

As it stands at the moment, it's not clear to me why we even bother with
opaque objects, if it's going to be this trivial to break encapsulation.


Reply via email to