Uri Guttman <[EMAIL PROTECTED]> writes: >>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes: > > >> 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 > > DS> Hmmm. I think we can use one thing for both perl pairs and scheme > DS> pairs. We'll need to be careful in spots, though. Perl pairs must > DS> have scalars on either side. (Just as arrays and hashes can only hold > DS> scalars, not arrays or hashes or lists) > > but lisp dotted pair actually only can hold scalars in each node > too. each node could be a pointer to other stuff or a value. that is > classic lisp data structures, all things are trees or lists made from > pairs.
Unless I'm completely misunderstanding the lisp refs I've been reading recently, a scheme pair is restricted to holding pointers. Either to other pairs or to things. If you represent it as an array, then you can have: [\"string", $next_pair is reference] but you couldn't have: ["car", $cdr is referent] But I could be *way* off the mark there. -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?