Main and auxilliary functions can appear in any order in the definitions window. The only requirement on definition order is that test cases using the function must appear after the main and auxilliary function definitions.
No DrScheme notes for this section.
When you are defining only functions, the order of definitions does
not matter. However, the order for variable definitions is
significant, because DrScheme evaluates the right-hand side
immediately, without looking at the remaining definitions. Therefore,
(define RADIUS 5) (define DIAMETER (* 2 RADIUS))
(define DIAMETER (* 2 RADIUS)) (define RADIUS 5)
RADIUS
when it tries to evaluate (* 2 RADIUS)
.
Exercise Notes
Exercise 3.3.1 Three dots in a row, ...
, is a
legal Scheme name. DrScheme does not attempt to determine the
meaning of a name until necessary. For this reason, you can type in
temporary definitions for all of the functions like this:
(define (feet->yards f) ...)
...
in each function and test
it.