Namespaces

 
0.2.0-SNAPSHOT permalink Arrow_down_16x16

memfn-varargs

clj-ssh.ssh

  • (memfn-varargs name)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clj_ssh/ssh.clj:447 top

(defmacro memfn-varargs [name]
  `(fn [target# args#]
    (condp = (count args#)
      0 (. target# (~name))
      1 (. target# (~name (first args#)))
      2 (. target# (~name (first args#) (second args#)))
      3 (. target# (~name (first args#) (second args#) (nth args# 2)))
      4 (. target# (~name (first args#) (second args#) (nth args# 2) (nth args# 3)))
      5 (. target# (~name (first args#) (second args#) (nth args# 2) (nth args# 3) (nth args# 4)))
      (throw
       (java.lang.IllegalArgumentException.
        (str
         "too many arguments passed.  Limit 5, passed " (count args#)))))))
Vars in clj-ssh.ssh/memfn-varargs: defmacro name = apply concat condp count first fn list nth second seq str vector
Used in 0 other vars

Comments top

No comments for memfn-varargs. Log in to add a comment.