[plt-scheme] Question about Intermediate Student
So, one of the things about Intermediate Student is that you can use
functions as arguments and return functions. So, following along in
section 23, we've been writing stuff like:
(define (arithmetic-sequence a0 d)
(local
[(define (seq n)
(cond
[(zero? n) a0]
[else (+ (seq (sub1 n)) d)]))]
seq))
The problem is that you can pass the result of this function to other
functions, but you can't call it.
(build-list 5 (arithmetic-sequence 2 3)) --> (list 2 5 8 11 14)
but
((arithmetic-sequence 2 3) 0) produces an error.
Is this intended behavior? Intermediate with Lambda works fine, but it
seems weird that you can create functions that you can't then use as
functions except through other higher-order functions.
Todd