Better HN
topnewbestaskshowjobs
Log inSign up

jaspingrobus

1 karma · joined Nov 30, 2026 (3d ago) · 1 submissions

Submissions

comment 3d ago · link · parent

I think you can do this in Clojure:

  (defn greet
    ([] "Hello!")
    ([name] (str "Hello, " name "!"))
    ([name title] (str "Hello, " title " " name "!")))
Which one could argue is cleaner for multiple arguments, but you can't pattern match on arguments themselves this way (but you can using multimethod)