Add option to generate a function
Hello, thank you for this macro. It is very useful because I really think that there is no need for a new syntax for something as simple as this. However, there is a feature that I wish this macro has: being able to define new functions using the pipe macro. I use functional programming a lot, and one way to create point free functions is by piping several of them. If this macro provides that it will be perfect for almost any use case.
Regards
Could u give an example of the input & output?
Sure! Basically for point free function composition
Input
const normalize = pipe(capitalize, camelCase, trim)
Output
const normalize = (... args) =>
trim(camelCase(capitalize(... args)))
That would make a good pipe.macro. At first it was going to be this macro's name but then I thought about your use case and thought I'd better name it pipeline.macro.
When I get some free time in following days I might create the other one.
Oh, Thank you for thinking on the future ourselves! :smile: To be honest, I didn't even noticed your macro was pipeline instead of pipe!
Hello again @Andarist ,
I just created a small macro that does what we have been discussing. Is basically a fork of yours with some small changes.
If you want to publish if yourself (at the end is based on your work) I can provide you the code.
If you are Ok with it, I can fork your project and publish it under the pipe name.
Whatever you prefer.
Regards
I don't mind you forking this project and adjusting it to create pipe.macro - you could even fork it once again later to create compose.macro 😅