Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-flip inside ->> #386

Open
meedstrom opened this issue Sep 13, 2021 · 1 comment
Open

-flip inside ->> #386

meedstrom opened this issue Sep 13, 2021 · 1 comment
Labels
enhancement Suggestion to improve or extend existing behavior

Comments

@meedstrom
Copy link

meedstrom commented Sep 13, 2021

Hi, it'd be nice to be able to do this

(->> '("foo" "bar" "baz")
  ((-flip #'string-join) ","))

Of course there's s-join so we don't need -flip in this case, but it illustrates the principle. To be able to modify any function, also with -not, -applify etc.

I've no experience with Clojure, so if there's an alternative method, I'd be happy to hear about it!

@alphapapa
Copy link

This would add an extra function call to the expanded code, so you could use --> instead, to avoid that. Of course, sometimes using ->> is more convenient, and switching all of the forms to use --> is awkward, so this could be useful.

@basil-conto basil-conto added the enhancement Suggestion to improve or extend existing behavior label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Suggestion to improve or extend existing behavior
Projects
None yet
Development

No branches or pull requests

3 participants