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
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to