@@ 7,12 7,14 @@
@{})
(defn- registry-fields
- [sym]
- (get-in proto-field-registry [sym]))
+ [current-file name]
+ (get-in proto-field-registry [current-file name]))
(defn- registry-register
- [key value]
- (put proto-field-registry key value))
+ [current-file name value]
+ (unless (in proto-field-registry current-file)
+ (put proto-field-registry current-file @{}))
+ (put-in proto-field-registry [current-file name] value))
#
# Bootstrapping
@@ 56,10 58,9 @@
(cond
(not (symbol? obj)) (fields obj)
(dyn obj) (fields (eval obj))
- true (if-let [reg-key (string (dyn :current-file) "-" obj)
- listing (registry-fields reg-key)]
- listing
- (maclintf :normal "no prototype definition found for %s" (string obj)))))
+ (if-let [listing (registry-fields (dyn :current-file) obj)]
+ listing
+ (maclintf :normal "no prototype definition found for %s" (string obj)))))
#
# Field Validation
@@ 106,7 107,7 @@
:proto-allocations @{}
:instance-defaults @{}
:getters @{}}]
- (registry-register (string (dyn :current-file) "-" name) defined-fields)
+ (registry-register (dyn :current-file) name defined-fields)
(loop [entry :in fields
:when (= 2 (length entry))