lfe-deprecated / clj

MERGED to LFE - Clojure-inspired macros and functions for use in LFE
28 stars 2 forks source link

Clojure threading macros #29

Open stephenmuss opened 8 years ago

stephenmuss commented 8 years ago

Hi there,

Nice work bringing some of the great parts of Clojure to LFE.

I'm not sure whether it is even feasible but it would be great to see some of Clojure's threading macros introduced to this library. In particular the -> thread-first and ->> thread-last macros.

Another comparison would be Elixir's |> pipe operator.

rvirding commented 8 years ago

The macros you mentioned are/will be in the basic clj library. Isn't elixir's pipe macro equivalent to -> or ->>? Though to be honest I would have very little use of it as it is usually to simple for what I need as there is no handling of pattern matching. I generally find using let*, which can handle matching, to be more useful.

stephenmuss commented 8 years ago

Elixir's pipe operator is indeed equivalent to ->. I thought it was worth mentioning given its relationship to Erlang.

yurrriq commented 8 years ago

I've added a few more of Clojure's threading macros too in https://github.com/rvirding/lfe/pull/267.