|
Is there any particular way that we should represent our ratintvl. Should we do something similar to the procedure representation in Assignment #6 as opposed to a pair of two rationals?
I think that my description of the requirement is precise and unambiguous on this point:
an interval is represented by a list of two elements, (r1 r2)
If you want to propose a change, I'm happy to put it up for a vote.
- Advantage of marking:
- avoid confusion with lists of 2 rationals that were not generated by
ratintvl_ratpair procedures.
- Disadvantage:
- we have to reserve some particular symbol, such as
ratintvl_ratpair, to mark the pairs that are particularly to be understood as representations of ratintvls. Every such reserved symbol is a potential problem for a programmer who accidentally collides with it. This one looks very unlikely, but as they accumulate, life becomes confusing. If we really want to mark the type of the pair, it would be better to figure out how Scheme does this for its own predefined types, and try to follow the same method.
Mike O'D.
|