Piers Cawley wrote:

Bugger. I was hoping that Perl 6 was going to make a Pixie like Object
database easier to write; looks like I'm wrong. One of the things
Pixie does is to attach its control data by magic to the object itself
(rather than any particular variable pointing to it). This lets us do
all sorts of useful stuff without invading the object since we know
that it will carry our metadata around it. Please, consider making
<but> properties attach to the target of a pointer rather than to the
pointer itself.
Err....no. That's rather the whole point of C<but> properties [*].

However, if your class returns a reference to an object and that reference
has the appropriate value properties ascribed to it (i.e. stuck on the *reference*), then any access through that reference (or through any subsequent copy of it) will see those properties.

So your magic Pixie would look something like"

class Pixie {

method new($class: %args) {
return $class.SUPER::new(%args)
but Magic('whatever');
}

# etc.
}

Damian


[*] People, we just *have* to find better names for these things!
I'd suggest we henceforth call them "value" properties (for C<but>)
and "referent" properties (for C<is>).



Reply via email to