Last active
August 29, 2015 14:09
-
-
Save ndpar/4d43820195e8410e7f6d to your computer and use it in GitHub Desktop.
How to redefine procedure in Racket.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax-rule | |
(redefine (f args ...) body ...) | |
(set! f (λ (args ...) body ...))) | |
(define (double x) | |
(+ x x)) | |
(redefine (double x) | |
(* 2 x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment