Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Some extra reference types

7 views
Skip to first unread message

Jonathan Worthington

unread,
Sep 3, 2006, 6:15:58 PM9/3/06
to parrot-...@perl.org
Hi,

As discussed at YAPC::Europe, here's my suggestions for two new core
PMCs to handle:

* References to a particular element in an aggregate type
* References to a register

The second of these needs an opcode to create it, which I have
proposed a name for. The first of them I'd *like* to have an opcode to
create for consistency, but we can do it by passing stuff to
parameters to the PMC initialization method I *think* (can we?).

These are basically working in .Net and the plan is to move the
functionality into the core, as well as complete the safety stuff in
the Parrot core to really get the "weak reference" semantics when
referencing a register.

Anyway, suggested PDD patch attached. Comment away. :-)

Jonathan

refs.diff

Leopold Toetsch

unread,
Sep 4, 2006, 6:45:45 AM9/4/06
to perl6-i...@perl.org
Am Montag, 4. September 2006 00:15 schrieb Jonathan Worthington:
> Hi,
>
> As discussed at YAPC::Europe, here's my suggestions for two new core
> PMCs to handle:
>
> * References to a particular element in an aggregate type
> * References to a register

NB: typical usage for these besides dotnet: Tcl's upvar or P5 local lvalue
refs (maybe).

> The second of these needs an opcode to create it, which I have
> proposed a name for. The first of them I'd *like* to have an opcode to
> create for consistency, but we can do it by passing stuff to
> parameters to the PMC initialization method I *think* (can we?).

We can pass one additional PMC argument, which is handled by the C<init_pmc>
vtable.

.local pmc reg_ref, initializer
...
reg_ref = new .WeakRegisterRef, initializer

It's up to the PMC what the initializer actually is.

> These are basically working in .Net and the plan is to move the
> functionality into the core, as well as complete the safety stuff in
> the Parrot core to really get the "weak reference" semantics when
> referencing a register.

> Jonathan

leo

0 new messages