Skip to content

Instantly share code, notes, and snippets.

@wilbowma
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save wilbowma/22435ea5697bb7f3b43b to your computer and use it in GitHub Desktop.

Select an option

Save wilbowma/22435ea5697bb7f3b43b to your computer and use it in GitHub Desktop.
#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