Uri Guttman <[EMAIL PROTECTED]> writes:

>   >> Is this then the same datatype as a Perl6 pair (cf '=>' op in Apo 3) ??
> 
>   DS> Good point. it probably is, yes. (Though there may be potential 
>   DS> differences--depends on whether the scheme pair can only have scalars 
>   DS> on each side, or should allow other things)

> that can be handled by the compiler to some degree. and from my lisp
> knowledge, a dotted pair can contain anything in each node. so i expect
> scheme pairs to map nicely onto perl6 pairs. 

Correct, especially a list is nothing but a pair with another pair or
an end-of-list-marker in its second element. To implement set-car! and 
set-cdr! both elements of this pair must be mutable

> this implies that pairs
> should be supported directly in parrot since you can do many
> optimizations knowing the array has only 2 elements. maybe even support
> some car/cdr depth variations? i don't see any perl use of cddar but who
> knows?

Sure. One optimization that comes to my mind, is make the PMC big
enough to hold 2 PMC-pointers. (actualy it is, if you abuse the
data-pointer of which I don't know what its good for). My actual patch 
uses the same way PerlArray does with KEY* and KEYPAIR* and the needed 
indirections.

bye
Jürgen

Reply via email to