clojure icon indicating copy to clipboard operation
clojure copied to clipboard

partial and comp verses anonymous functions (lambda)

Open practicalli-johnny opened this issue 4 years ago • 0 comments

partial vs lambas lambdas are considered more idiomatic than partial and comp

reasons to prefer lambdas?

They are often shorter, and often produce nicer stacktraces

The behavior of comp and partial when used to create top level defs can be surprising when you redefine things

I believe rich has at least once said partial wouldn't be part of clojure.core if the function short hand syntax had existed first

I think nicer stacktraces is the "big reason" I was looking for. Thanks!

They are also easier to debug - if that’s your thing; I find cider’s debugger very useful

practicalli-johnny avatar Oct 23 '21 08:10 practicalli-johnny