[ANN] etrans
Serge Aleynikov <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CANt451=E_2SBM__S6LjdDgm3PLgYz1B16z2VTrZp6jZvKr8AxA@mail.gmail.com> |
I'd like to announce the release of etrans - the set of parse transforms
that bring some convenient syntax features that improve code readability:
https://github.com/saleyn/etran
etrans implements an Elixir-like pipeline using the following syntax:
print(A) ->
[A] / element(1, A)
/ io:format("~s\n", [_]).
test(Arg1, Arg2) ->
[Arg1, Arg2]
/ fun1
/ mod:fun2
/ fun3()
/ fun4(Arg3, _)
/ io_lib:format("~p\n", [_])
/ fun6([1,2,3], _, other_param)
/ fun7.
Additionally, it implements ternary "if" (i.e. iif(Cond, True, False)), and
stringification transforms, including "throw(Format, Args)".
Enjoy!
Serge