Front page | perl.perl6.internals |
Postings from January 2002
From: Buddha Buck
January 24, 2002 08:45
Message ID: email@example.com
At 11:32 AM 01-24-2002 -0500, Dan Sugalski wrote:
>At 4:19 PM +0000 1/24/02, Dave Mitchell wrote:
>>Dan Sugalski <firstname.lastname@example.org> wrote:
>>> That was my biggest objection. I like the thought of having a scheme
>>> pair data type. The interpreter should see it, and it should be
>>> accessed, as a restricted array, one with only two entries.
>>Is this then the same datatype as a Perl6 pair (cf '=>' op in Apo 3) ??
>Good point. it probably is, yes. (Though there may be potential
>differences--depends on whether the scheme pair can only have scalars on
>each side, or should allow other things)
In scheme, at least, pairs can contain any data on either side. The
notation for a pair is (value . value), and standard list notation (a b c d
e f g) is simply syntactic sugar for (a . (b . (c . (d . (e . (f . (g .
'()))))))). Although only the cdr of these pairs contain pairs, in a list
like ((a a) (b b)) (also written as "((a . (a . '())) . ((b . (b . '())) .
'()))"), both the car and cdr of the outermost pair contain pairs.