Liking cljdoc? Tell your friends :D

robertluo.fun-map.oop

Object Oriented Functional pattern experiment.

Object Oriented Functional pattern experiment.
raw docstring

+>cljmacro

(+> obj method & args)

Calls a method of obj

Calls a method of obj
sourceraw docstring

defobjectcljmacro

(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.
sourceraw docstring

object-speccljmacro

(object-spec obj-spec mixins prop-specs)

Define spec for object

Define spec for object
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close