Dan Sugalski wrote:
> 
> 'Kay, here's the preliminary assembly-level docs for keys, which is how
> we're going to be accessing entries in aggregates.
> 
> --------------Snip here---------------
> =head2 Key operations
> 
> Keys are used to get access to individual elements of an aggregate
> variable.  This is done to allow for opaque, packed, and
> multidimensional aggregate types.
> 
> A key entry may be an integer, string, or PMC. Integers are used for
> array lookups, strings for hash lookups, and PMCs for either.
> 
> =over 4
> 
> =item new_key Sx

The fact that the S registers are in fact generic struct registers is
not evident from outside the internal code. For those of us implementing
instructions, it might be useful to explicitly cast values like $1 to
the correct type, in order to make sure we recognize this.

The following code came up frequently when writing the key() functions
that Dan enumerated int his file...

key_inc(interpreter, $1, $2);
Explicitly casting $1 to (KEY*) helps reinforce this fact, eliminates a
compile-time warning, and doesn't cost any runtime penalty.

--
Jeff <[EMAIL PROTECTED]>

Reply via email to