Front page | perl.perl6.internals |
Postings from January 2002
Re: scheme-pairs?
Thread Previous
|
Thread Next
From:
Buddha Buck
Date:
January 24, 2002 08:45
Subject:
Re: scheme-pairs?
Message ID:
5.1.0.14.0.20020124113155.02b01550@mail.mac.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 <dan@sidhe.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.
Thread Previous
|
Thread Next