On Mon, Mar 17, 2014 at 09:16:25PM -0700, Timothy Pratley wrote:
> I came up with this:
> 
> (condp #(%1 %2) 1
>   neg? "neg"
>   zero? "zero"
>   pos? "pos"
>   = "default")
> 
> Which I wouldn't so much mind if I knew the name for #(%1 %2)

I usually call it `funcall` (like in Common Lisp):

  (defn funcall [f & args]
    (apply f args))

You can also just have an odd number of arguments, in which case the
last one is the "default" case:

  (condp funcall 1
    neg? "neg"
    zero? "zero"
    pos? "pos"
    "default")

Attachment: signature.asc
Description: Digital signature

Reply via email to