2 summary::LISP-like two element cells
3 categories:: Collections>Ordered
8 Implementation incomplete. See link::Guides/J-concepts-in-SC:: for similar functionality.
11 Most methods are inherited from the superclasses.
19 Convert collection (e.g. arrays of arrays) to pairs.
23 private::storeOn, printOn, storeArgs
26 Return the size when linking across.
29 Return the size when linking down.
32 Iterate over the two elements.
35 Same like: link::#-depthFirstPreOrderTraversal::
37 method::depthFirstPreOrderTraversal
38 Traverse the data structure first link down, then across (see link::#Examples::).
40 method::depthFirstPostOrderTraversal
41 Traverse the data structure from bottom up (see link::#Examples::).
46 a = Pair(Pair(Pair(1, 2), 4), Pair(5, 6));
50 a.do { |x| x.postln };
51 a.traverse { |x| x.postln };
52 a.depthFirstPreOrderTraversal { |x| x.postln };
53 a.depthFirstPostOrderTraversal { |x| x.postln };
56 // alternative instantiations:
58 Pair.newFrom([1, [2, [[4, 5], 6]]]);
60 [1, [2, [[4, 5], 6]]].as(Pair); // equivalent.