-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add 👍 and 👎 for constructing ranges #40298
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
Conversation
I love it, finally a syntax proposal that will help beginners |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make Julia easier to use for emoji oriented users, opening Julia to a new generation.
Why not add 📈 and 📉 for randomly increasing and decreasing ranges? |
Even though this is a joke (I think I can give that away now that it's April 2nd), I can't see much actual harm in doing it. You can still use 👍 and 👎 as identifiers if you want to, they just also parse as infix operators like the word |
Would be slightly breaking for identifiers containing 👍, but looks like we're fine on that front: https://juliahub.com/ui/RepoSearch?q=%F0%9F%91%8D&r=true |
Why? I haven't looked it this PR currently breaks that but it's perfectly possible to allow 👍 in identifiers but make 👍 by itself an infix operator. (This is why I used |
We don't require whitespace around operators, so |
I should note that space is required around 👍 and 👎 with this PR, since otherwise
Not entirely true: |
Ah, sorry, I didn't read the PR closely enough then |
Closing as "surprisingly plausible, but still a bit ... much". |
When people don't code quote their ranges, markdown will render a specified step size as 👍 or 👎. It does what you want, so why not make it syntax? This PR adds 👍 for a range with positive unit step size and 👎 for a range with negative unit step size.