Skip to content

Feature-request: Python-like lambdas #12

@Quail-Language

Description

@Quail-Language

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions