Liking cljdoc? Tell your friends :D
Clojure only.

hara.object.framework.string-like


extend-string-likecljmacro

(extend-string-like cls {:keys [read write meta] :as opts})

creates an entry for string-like classes

(extend-string-like java.io.File {:tag "path" :read (fn [f] (.getPath f)) :write (fn [^String path] (java.io.File. path))})

(object/from-data "/home" java.io.File)

(with-out-str (prn (java.io.File. "/home"))) => "#path "/home"\n"

creates an entry for string-like classes

(extend-string-like
 java.io.File
 {:tag "path"
  :read (fn [f] (.getPath f))
  :write (fn [^String path] (java.io.File. path))})

(object/from-data "/home" java.io.File)

(with-out-str
  (prn (java.io.File. "/home")))
=> "#path \"/home\"\n"
raw docstring

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

× close