Created
June 8, 2011 17:14
-
-
Save tonyg/1014851 to your computer and use it in GitHub Desktop.
Compile-time loading of constant JSON data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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