SuperCollider CLASSES


LISP-like two element cells
Inherits from: Collection : Object


NOTE: Implementation incomplete. See J concepts in SC for similar functionality.

Most methods are inherited from the superclasses.

Class Methods

*new (linkDown, linkAcross)

Return new instance.

*newFrom (collection)

Convert collection (e.g. arrays of arrays) to pairs.

Inherited class methods

Instance Methods


Return the size when linking across.


Return the size when linking down.

-do (function)

Iterate over the two elements.

Traverse Same like: -depthFirstPreOrderTraversal

-depthFirstPreOrderTraversal (function)

Traverse the data structure first link down, then across (see Examples).

-depthFirstPostOrderTraversal (function)

Traverse the data structure from bottom up (see Examples).

Inherited instance methods

Undocumented instance methods


-linkAcross = value


-linkDown = value

-traverse (function)


a = Pair(Pair(Pair(1, 2), 4), Pair(5, 6));

a.depth; { |x| x.postln };
a.traverse { |x| x.postln };
a.depthFirstPreOrderTraversal { |x| x.postln };
a.depthFirstPostOrderTraversal { |x| x.postln };

// alternative instantiations:

Pair.newFrom([1, [2, [[4, 5], 6]]]);

[1, [2, [[4, 5], 6]]].as(Pair); // equivalent.