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

Need a pretty "apply" #11

Open
tylerperkins opened this issue Apr 30, 2016 · 4 comments
Open

Need a pretty "apply" #11

tylerperkins opened this issue Apr 30, 2016 · 4 comments

Comments

@tylerperkins
Copy link

I think the apply function is a natural candidate to be replaced by a pretty symbol. It is a higher-order function that one often uses to shape the structure of code, like partial or comp. Consider that many Clojure functions are variadic, yet are often needed to operate on a collection: concat, +, str, distinct?, etc. The use of apply is so common, you eventually think of it as just a different way of calling a function, like Python's * (splice), or JS2015's ... (spread) operator.

May I suggest the ellipsis symbol . That's Option-; on a Mac.

@swr1bm86
Copy link
Owner

swr1bm86 commented Apr 30, 2016

what about the left arrow symbol ? i think ellipsis symbol does not show the meaning of apply function directly.

@tylerperkins
Copy link
Author

I like because it is visually distinct from anything else (except "_", which cannot be used as a function or macro name), and it's similar to the "spread" operator from JavaScript and Java. I don't really see as reminiscent of apply, and it has the problem of being similar to the threading symbols.

How about this: The association should really be with Clojure's version of "spread", the ampersand &, but inverted: ⅋. That idea is really starting to grow on me. Alternatively, you could base the symbol on the letter a, for "apply", say alpha, , which is a greek letter like lambda, and kind of reminiscent of the comp symbol, both of which have to do with functions.

@swr1bm86
Copy link
Owner

looks good to me 😄 , how about the single greek letter to represent apply function ?

@tylerperkins
Copy link
Author

I'd be curious about what other Clojure programmers prefer. Alpha (∝) is good. I guess my favorite is ⅋, because apply inserts a list of trailing function arguments, while & destructures a list of trailing function parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants