Your composex macro is very similar to the various forms from the (as far as I can tell) fairly well-known threading package:
http://docs.racket-lang.org/threading/index.html Disclaimer: I am the author of the threading package. In any case, there are some differences, but it has the same general feel, and it might suit your needs. Alexis > On May 4, 2018, at 14:57, dexterla...@gmail.com wrote: > > Hi there, > > This is my first post, pardon my ignorance. I have been using a homemade > macro to compose functions together, but still allow semi-currying of > functions (with lambdas) to keep control of the parameters : > > (define-syntax (composex stx) > ; macro to compose functions passing an 'x' parameter > (syntax-case stx () > ((_ f1 ...) > (with-syntax ([x-var (datum->syntax stx 'x)]) > #'(compose1 (λ (x-var) f1) ...))))) > ; unit test > (check-equal? ((composex (string-replace x " " "-") > (string-downcase x) > (string-trim x)) "Hello World") > "hello-world") > > > I often use this or (apply composex (reverse v)) to keep function > applications in order. > > Can you comment on this? Do you think this could be part of the language? > > Cheers, > > Dexter > > P.S. For use in the wild, see provide-generator. Makes generate-provide more > readable : > https://github.com/DexterLagan/provide-generator -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.