Moritz writes:

>> Objects that you can't do that with don't make sense to be serialized and so
>> .perl can reasonably refuse to work on them.
>
> method perl {
>    die "Can't serialize objects of type $?CLASS, because ...";
> }

Sure. But now the cautious programmer has to add that to *every* class
hierarchy.
So we start to see endless variations on:

    role ProperlyEncapsulated { method perl {die} }

    class MyClass does ProperlyEncapsulated {...}
    class AnotherClass does ProperlyEncapsulated {...}
    class YetAnotherClass does ProperlyEncapsulated {...}

which would be a sad indictment on Perl 6's otherwise brilliant OO model
(and will encourage all the OO bully languages to publicly kick sand
in our face).


> My proposal: the default .perl method should only spit out value for
> public attributes, ie those that have accessors.

I'd be happy with that.

> Maybe .new should also default to his behavior.

I'd be happy with that too.


>> Then Damian's position (which I support) is supported and so are monkeys.
>
> Ook ook!

"Apes! I meant apes!!!" ;-)


> Moritz
> (who actually writes Perl 6 code on a nearly daily basis).

Damian
(who does too)

Reply via email to