On Sat, Apr 02, 2005 at 11:22:43AM +0200, Leopold Toetsch wrote:
: Larry Wall <[EMAIL PROTECTED]> wrote:
: >: On Thu, 2005-03-31 at 23:46 -0800, Darren Duncan wrote:
: >: In P6, an object is a data-type. It's not a reference, and any member
: >: payload is attached directly to the variable.
: > Well, it's still a reference, but we try to smudge the distinction in P6.
: A reference as a Perl5 reference or just as a C pointer or a Parrot PMC?
In that context, I just meant somebody's got a pointer to it somewhere,
if only in the symbol table, though it could also be in a PMC.
As I mentioned in a recent message, Perl 6's notion of identity is
class based. "Perl5" refs are not really objects in that sense of
having an identity. If $foo contains a reference to something else,
you have to work harder to get at the container $foo rather than object
$foo points to. By default, any OO operation is going to deref it,
and that includes asking it for its identity, or asking its class to
compare two of its objects for identity.
Does this make sense? The only application I see for typed references
is to tunnel object references through some other language so that that
language sees the reference as an object of its type, but if it calls
back into your language, you get your original object reference back.
I'd classify that as a necessary evil, but one I'd prefer to hide from
stock Perl 6 programmers.