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

(chore/fix) Elixir keywords need some serious help #3210

Closed
joshgoebel opened this issue May 30, 2021 · 4 comments · Fixed by #3212
Closed

(chore/fix) Elixir keywords need some serious help #3210

joshgoebel opened this issue May 30, 2021 · 4 comments · Fixed by #3212
Labels
bug good first issue Should be easier for first time contributors help welcome Could use help from community language

Comments

@joshgoebel
Copy link
Member

I know that this PR merely reformats the list, but it caught my attention because there are a lot of keywords in it that I have never seen in Elixir. Also let my starts by saying that I am not sure if there is a formal definition of a "keyword". I'm using that term rather intuitively.

As far as I know, those are not Elixir keywords at all:

  • begin
  • break (Inspect.Algebra.break/1 is a function in the standard lib, but it has nothing to do with breaking out of loops like it might do in other languages)
  • defined
  • ensure
  • include
  • module
  • next (OptionParser.next/2 is a function in the standard lib, it has nothing to do with skipping to another iteration in a loop like it might do in other languages)
  • redo
  • retry
  • return
  • until
  • while

I'm unsure about:

  • self. It exists, but IMO it is a normal macro, not a keyword. I wouldn't expect it to be colored differently than other normal macros (like rem, round, trunc etc).
  • then. It's a new macro added in Elixir 1.12 together with tap, I don't think those are keywords.
  • with|0. I'm not sure what the pipe and zero mean here. with on its own is definitely a keyword.

Missing IMO:

Originally posted by @angelikatyborska in #3207 (comment)

@joshgoebel
Copy link
Member Author

there are a lot of keywords in it that I have never seen in Elixir.

I'm starting to think this grammar may just have been borrowed/copied from another long ago (as often happened)... it seems based on this feedback that it has many flaws.

with|0. I'm not sure what the pipe and zero mean here. with on its own is definitely a keyword.

The |0 is a signal that the keyword should have 0 relevance (vs the default of 1) because it's too common. This is to aid auto-detection of languages (which is something I don't think Exercism cares much about, but we do).

@joshgoebel joshgoebel added bug good first issue Should be easier for first time contributors help welcome Could use help from community language labels May 30, 2021
@joshgoebel
Copy link
Member Author

@angelikatyborska Willing to whip up a PR based on your observations just to cleanup the keyword list (on top of the work in the PR that led us to this discussion)?

@angelikatyborska
Copy link
Contributor

@joshgoebel Yes, I can help out with this issue. I can start today, but if I don't finish until the end of the day, it will probably wait until next weekend (UTC+2 time).

@joshgoebel
Copy link
Member Author

There is no rush unless you're in a hurry. :) Looking forward to it whenever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Should be easier for first time contributors help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants