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

Feature-request: Python-like lambdas #12

Open
Quail-Language opened this issue Mar 22, 2024 · 0 comments
Open

Feature-request: Python-like lambdas #12

Quail-Language opened this issue Mar 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Quail-Language
Copy link
Owner

Right now (as of issue creation time) anonymous functions can only be declared like this:

f = (x) -> return x^2

Which gets pretty annoying when it comes to using functions like map:

map((x) -> return num(x), input().split())

The suggestion is that another operator should be added, which will allow creation of one-expression instant-return lambdas:

map((x) => num(x), input().split())

Suggestions for operator symbol:

  • =>
  • ->:
  • other suggestions could be added in comments below

This operator should be a syntaxic sugar and at parse-time should unfold into regular lambda.

@Quail-Language Quail-Language added the enhancement New feature or request label Mar 22, 2024
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