If you want to change selection, open document below and click on "Move attachment"
2.2 Data Abstractionew can be applied broadly, including to the pair values
that we used to implement rational numbers. We never actually said much about
what a pair was, only that the language supplied the means to create and
manipulate lists with two elements. <span>The behavior we require to implement
a pair is that it glues two values together. Stated as a behavior condition,
If a pair p was constructed from values x and y , then
select(p, 0) returns x , and select(p, 1) returns
y .
We don't actually need the list type to create pairs. Instead, we can
implement two functions pair and select that fulfill this description
just as well as a two-element list.
Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details