Last active
August 29, 2015 13:56
-
-
Save bhyde/9234205 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defvar *variable-memory* (make-hash-table :test #'equal)) | |
(fare-memoization:define-memo-function (intern-variable :table *variable-memory*) (name variable-specs) | |
(flet ((field? (n) | |
(cdr (assoc n variable-specs)))) | |
(make-instance 'variable | |
:name (json:lisp-to-camel-case (symbol-name name)) | |
:concept? (field? :concept) | |
:label (field? :label)))) | |
(defun make-variable (dataset name variable-specs) | |
(let ((v (intern-variable name variable-specs))) | |
(pushnew dataset (appears-in v)) | |
v)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment