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

Some Janet-specific golfs #328

Open
5 of 6 tasks
MeWhenI opened this issue Dec 29, 2023 · 0 comments
Open
5 of 6 tasks

Some Janet-specific golfs #328

MeWhenI opened this issue Dec 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@MeWhenI
Copy link
Contributor

MeWhenI commented Dec 29, 2023

This issue documents some language-specific golfs that can be added for Janet:

  • Use peg/replace-all over string/replace-all where possible #331
  • Convert if chain to cond
  • Convert (=(% x 2)0 to (even? x) and do the same for odd?
  • Convert (arr(-(length arr)1)) to (last arr)
  • Use struct syntax {} instead of table syntax @{} if a Table is never mutated
  • Introduce "`TEXT`" string literal: Cannot be empty or begin/end with a newline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant