@@ 141,6 141,16 @@
(eval (pred*-form 'Root))
+(defn- init-name [name] (symbol "new-" name))
+
+(defn- new-form
+ "Generate the init form wrapper."
+ [name]
+ (let [init-name (init-name name)]
+ ~(defn ,init-name [& rest] (:new ,name ;rest))))
+
+(eval (new-form 'Root))
+
(defn- getters
[name fields]
(let [forms @[]]
@@ 182,7 192,7 @@
`parent-name` is required; it can be an existing prototype, *or*
some null-ish value. If null-ish (`nil` or `()` should make the most
- sense...) the parent of the prototype will be set to `fugue/Root`.
+ sense...) the parent of the prototype will be set to `fugue/Root`.
`fields` should be 0 or more pairs of the following format:
@@ 265,6 275,7 @@
(put :new ,(init-form name init-args))))
(pred-form name)
(pred*-form name)
+ (new-form name)
;(getters name fields))))
(defn prototype?