Last active
August 29, 2015 14:20
-
-
Save wilbowma/22435ea5697bb7f3b43b 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
| #lang racket | |
| (require racket/trace) | |
| (require (for-syntax racket/trace)) | |
| (begin-for-syntax | |
| (current-trace-print-args | |
| (let ([ctpa (current-trace-print-args)]) | |
| (lambda (s l kw l2 n) | |
| (ctpa s (map syntax->datum l) kw l2 n)))) | |
| (current-trace-print-results | |
| (let ([ctpr (current-trace-print-results)]) | |
| (lambda (s l n) (ctpr s (map syntax->datum l) n))))) | |
| (define fresh #f) | |
| (define absento #f) | |
| (define membero #f) | |
| (define color #f) | |
| (define == #f) | |
| (define-values (lindo eriador forodwaith) | |
| (values #f #f #f)) | |
| (trace-define-syntax neighbors | |
| (syntax-rules () | |
| [(_ (a d* ...) colors) | |
| (fresh (color) | |
| (== `(,a . ,color) a) | |
| (absento color `(,d* ...)) | |
| (membero color colors))])) | |
| (expand #'(neighbors (lindo eriador forodwaith) '(1 2 3))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment