Created
December 31, 2014 04:33
-
-
Save nyuichi/867f2fe501264bdfb831 to your computer and use it in GitHub Desktop.
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 (make-generic) | |
| (letrec ((self (lambda args | |
| (let ((m (find-method self args))) | |
| (if m | |
| (apply m args) | |
| (error "method not found")))))) | |
| (add-generic self) | |
| self)) | |
| (eq? (make-generic) (make-generic)) ;=> #t OH, MY GOSH! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment