PasteRack.org
Paste # 53105
2019-10-16 12:59:43

Fork as a new paste.

Paste viewed 155 times.


Embed:

  1. #lang racket
  2.  
  3. (module m racket
  4.         (define foo (string->uninterned-symbol "foo"))
  5.         (provide foo))
  6.  
  7. (require 'm); (for-syntax 'm))
  8.  
  9. (define-syntax (test stx)
  10.                (syntax-case stx ()
  11.                             [(_ expr)
  12.                              #`(if (equal? expr (quote #,foo))
  13.                                    "it's foo"
  14.                                    "it's not foo")]))
  15.  
  16. (test foo)
  17. (test 'foo)

=>