[racket] Dynamically Bind Functions
I'm trying to replace a function with another using parameterize.
For example, when I try:
(define (add2 n)
(add1 (add1 n)))
(parameterize ([add1 (λ [n] (+ n 2))])
(add2 2))
I get an error:
parameterize: contract violation
expected: parameter?
received: #<procedure:add1>
How do I re-bind functions in Racket?
- Cristian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121221/02c529cf/attachment.html>