...
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-_s. This exercise just uses ideas you've already learned, but in new contexts.
- Define the type list of lists of _posn-_s.
- Write the templates template for list of lists of posn-_s. (NB: There are two non-primitive types here, one inductive the other an inductive type and one that simply consists of a structure. So writing a program that processes a list of positions may require using two templates; a template for lists of _posn-_s and a template for processing _posn-_s. If you need to use two templates, you _also need to write two functions, one to process a list of positions and one to process positions.)
- Write the function
positive-quadrant?
, which takes in a singleposn
and returns true only when its components are both positive. - Develop
count-positive-quadrant
, which takes a list of _posn-_s and returns a count of those in the upper-right quadrant. - Develop
filter-positive-quadrant
, which takes a list of _posn-_s and returns a list of those in the upper-right quadrant.
...