What's the current status of support for keyed ops? I'm tempted to
slap together at least partial support for some keyed operations
(they'd make some of my test code simpler, at the very least), but I'd
rather not work on out of date code. And I don't completely understand
what needs to be done.

Specific questions:

What's the plan for the assembler? I've been using Simon's newasm for
a while, but I'm hesitant to submit patches until it's added to CVS --
I don't know how far behind the current version I am.

The key PDD says that the 'keyed' keyword in vtable.tbl causes the op
to sprout a new version where all of its PMC parameters are followed
by a KEY*. I assume that the resultant ops would be written to
vtable.ops, but make_vtable_ops.pl only generates the ops listed in
its DATA section. Which leaves out some of the keyed ops:
[gs]et_integer, [gs]et_number, [gs]et_string, set_pmc, and
get_pmc_keyed. Why are there two lists of vtable ops?

Keyed stuff needs to emit snazzy new constants to the bytecode. Is the
bytecode format still too much in flux to accept that? Anyone planning
on adding this?

The various OpTrans/*.pm files need to support the key argument types
('kc' and 'r'). This is not a question, so maybe this post is now a
todo list.

Compound keys (eg ["foo";S0;P0] if I got the syntax right) need some
more designing, as Simon noted in pdd08_keys. I'll make a vague
suggestion: have boxed and unboxed keys, where compound keys are
always boxed. A PMC would serve as the box. The boxed keys would be of
the 'r' type (?). So the assembler would never directly use compound
keys. So instead of

  set S0, P0["foo";S0;P1]

it would be

  new P31, ParrotKey
  set P31[0], "foo" (translated to set P0[0], const_table[83])
  set P31[1], S0
  set P31[2], P1
  set S0, P0[P31]

I'm not sure whether the 'r' type works, though -- maybe there needs
to be a 'k' type which is explicitly a PMC known to be a (subclass of)
ParrotKey. Otherwise, P0[P1] needs to essentially do an
isa(P1,'ParrotKey') check of some sort, and do very different things
depending on the result.

Or maybe I should actually think about things before suggesting them.

Nah.

I'm not sure if the predereferencing mode will need to do something
fancy with keys.

Reply via email to