I have confused assignement and initialisation in my previous
mail. Because they are two different operations, there is no
problem they have different semantics. A6 described both
operations. It described pairs as arguments used to initialize
parameters and pairs in assignement.
--
stef
Stéphane Payrard <[EMAIL PROTECTED]> wrote:
> More generally, in pmcs that act as composite containers which
> elements are not necessarily pmc, we need these cloning methods as well:
> PMC* clone_pmc_keyed(PMC* key)
> PMC* clone_pmc_keyed_int(INTVAL key)
> PMC* clone_pmc_keyed_str(STRING*
My understanding of the semantic of pairs as in A6:
A pair in a given scalar context should return its first element
coerced to match the said context.
This seems to be a prerequisite to use pairs as function arguments.
Example with the boolean context:
bool $b = a => 10; # $b == 1