Object Oriented Functional pattern experiment.
Object Oriented Functional pattern experiment.
(defobject obj-name mix-ins & attributes)
Returns a constructor function takes a map as the argument, return the object. Following OO's tradition, suggest camel cased obj-name. mix-ins is a vector of other object which will merge into this object.
Example: (defobject Foo [Bar] :foo/baz (fnk [number] (inc number)) 'shout (fnk [:foo/baz] (fn [prompt] (str "Hello," baz))))
defines an object constructor Foo which mixins constructor Bar with attribute :foo/baz and method shout.
Returns a constructor function takes a map as the argument, return the object. Following OO's tradition, suggest camel cased obj-name. mix-ins is a vector of other object which will *merge* into this object. Example: (defobject Foo [Bar] :foo/baz (fnk [number] (inc number)) 'shout (fnk [:foo/baz] (fn [prompt] (str "Hello," baz)))) defines an object constructor Foo which mixins constructor Bar with attribute :foo/baz and method shout.
(object-spec obj-spec mixins prop-specs)
Define spec for object
Define spec for object
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close