Skip to content

Instantly share code, notes, and snippets.

@mflatt
Last active December 14, 2016 14:46
Show Gist options
  • Save mflatt/d569d8f3a89e6815cf18df26adc11053 to your computer and use it in GitHub Desktop.
Save mflatt/d569d8f3a89e6815cf18df26adc11053 to your computer and use it in GitHub Desktop.
#lang racket
(module property racket
(provide quote-syntax/add-example-property
id)
(define-for-syntax compile-time (current-inexact-milliseconds))
(define-syntax (quote-syntax/add-example-property stx)
(syntax-case stx ()
[(_ e) (with-syntax ([e+prop (syntax-property
#'e
'example
compile-time
#t)])
#'(quote-syntax e+prop))]))
(define id (quote-syntax/add-example-property id))
(syntax-property id 'example))
(require 'property)
(syntax-property (quote-syntax/add-example-property new-id) 'example)
(syntax-property id 'example)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment