Advertisement
Guest User

syntax/parse equality constraint

a guest
Oct 24th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #lang racket
  2.  
  3. (require (for-syntax syntax/parse))
  4.  
  5. (define-syntax (trivial-example stx)
  6. (syntax-parse stx
  7. [(_ (a . b))
  8. #''(b . a)]))
  9.  
  10. (trivial-example (c . d))
  11.  
  12. #;(define-syntax (equality-constraint-fail stx)
  13. (syntax-parse stx
  14. [(_ (a . a))
  15. #''(a . a)]))
  16. #;(equality-constraint-fail (e . f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement