Thanks for this one. Few things:

At 5:51 PM +0000 2/17/02, Simon Cozens wrote:
>=head1 DESCRIPTION
>
>First, let's define some terminology. An B<aggregate PMC> is one which
>supports and implements the C<_keyed> variants of vtable methods. These
>variants are B<indexing> operations, as they act on a specific indexed
>element of an aggregate PMC. Indexing operations take one or more
>aggregate-B<key> pairs. At runtime, these operations will index the key
>into the aggregate returning a B<value>. Here is a well-known indexing
>operation in Perl 6:

Non-aggregates can (and must) implement the _keyed vtable method, 
though it may well do nothing but throw an exception.

References, for example, will implement them, just passing the access 
down to the referent.

We could also, if we were feeling evil, use keyed access to do substr 
stuff on strings. (key 7 is character offset 7, for example) I think 
we'll not do that, though.

>This is a singularly bad name, and needs to change. Probably C<KEY_PART>
>is better. It's a shame C<KEY_ELEMENT> is so confusing, since it's accurate.

AGGREGATE_INDEX is good, but awfully big.

>=head2 Input to the assembler
>
>There are several different valid specifications of an aggregate-key
>pair to the assembler. These are:
>
>     op arg, P1[1234]  # Constant integer key
>     op arg, P1[12.34] # Constant number key

Do we want floating point keys? Though I suppose there's no real reason not to.

>     op arg, P1["foo"] # Constant string key
>     op arg, P1[S1]    # Register key
>
>(Rationale: fits programmer's expectation, easier to understand at a
>glance than C<op P1, P2, P3>. Also, is C<op P1, P2, P3> the same as
>C<op P1[P2], P3> or C<op P1, P2[P3]>, or are these three separate PMCs?)

And for the grumblers, of which there probably aren't many, do 
remember that almost nobody will be generating much assembly by hand, 
and unambiguous syntax is a good thing when we want to put as little 
brains in the assembler as we can manage.

Also, the only valid register spec inside the [] is Sx, where S 
register X has a key pointer in it that you created by hand with the 
key manipulation ops.

Other than that, really nice. Thanks, Simon!
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to