by qwertyuiop924 · 10y ago · 0 comments
(define (make-counter n)
(lambda (c)
(set! n (+ n c))
n))
This is a HOF, but not an instance of Strategy.call/cc does not actually use the passed in function to determine how any action should be done. All it does is provide a capture of the current continuation as an argument. That's it. So it's not a strategy, it's just a HOF.
And semantically, a continuation is pretty much never a strategy.
As for make-counter not being higher-order, that's just not true. A higher-order function takes and/or returns a function. make-counter returns a function: it's higher-order.