...
We've seen lists of symbols and lists of numbers; you can of course have a list with elements of any given type...including other structures like
posn
posn-s. This just uses ideas you've already learned, but in new contexts.
- Define the type of lists of posn posn-s.
- Write the templates of lists of posn posn-s. (NB: There are two non-primitive types here, one inductive the other a structure. So this may require two templates or one, depending on if you believe in structure templates.)
- Write the function
positive-quadrant?
, which takes in a single posn
and returns true only when its components are both positive. - Develop
count-positive-quadrant
, which takes a list of posn posn-s and returns a count of those in the upper-right quadrant. - Develop
filter-positive-quadrant
, which takes a list of posn posn-s and returns a list of those in the upper-right quadrant.
...