Skip to content

Instantly share code, notes, and snippets.

@tonyg
Created June 8, 2011 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyg/1014851 to your computer and use it in GitHub Desktop.
Save tonyg/1014851 to your computer and use it in GitHub Desktop.
Compile-time loading of constant JSON data
#lang racket
(require (for-syntax "json-parsing.ss"))
(define-syntax loaded-uci-descriptions
(lambda (stx)
(syntax-case stx ()
((_) #`(quote #,(call-with-input-file "uci-descriptions.js"
(lambda (f) (json->sjson f))))))))
(define uci-descriptions (loaded-uci-descriptions))
(provide uci-descriptions)
(pretty-print uci-descriptions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment