Class silk.Pair
java.lang.Object
|
+----silk.SchemeUtils
|
+----silk.Pair
- public class Pair
- extends SchemeUtils
A Pair has two fields, first and rest (or car and cdr).
The empty list is represented by null. The methods that you might
expect here, like first, second, list, etc. are instead static methods
in class SchemeUtils.
|
Field Summary
|
|
java.lang.Object
|
first
The first element of the pair.
|
|
java.lang.Object
|
rest
The other element of the pair.
|
|
Constructor Summary
|
Pair(java.lang.Object first,
java.lang.Object rest)
Build a pair from two components.
|
|
Method Summary
|
|
boolean
|
equals(java.lang.Object x)
Two pairs are equal if their first and rest fields are equal.
|
|
java.lang.String
|
toString()
Return a String representation of the pair.
|
| Methods inherited from class silk.SchemeUtils
|
| chr, chr, cons, equal, eqv, error, first, inPort, length, list, list, listStar, listToString, listToVector, num, num, outPort, rest, reverse, second, setFirst, setRest, str, sym, third, truth, truth, vec, vectorToList, warn, write |
| Methods inherited from class java.lang.Object
|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
first
public java.lang.Object first
- The first element of the pair.
rest
public java.lang.Object rest
- The other element of the pair.
Pair
public Pair(java.lang.Object first,
java.lang.Object rest)
- Build a pair from two components.
equals
public boolean equals(java.lang.Object x)
- Two pairs are equal if their first and rest fields are equal.
- Overrides:
- equals in class java.lang.Object
toString
public java.lang.String toString()
- Return a String representation of the pair.
- Overrides:
- toString in class java.lang.Object