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

Changed lambda literal syntax to be more concise (issue #1391) #1400

Merged
merged 2 commits into from
Nov 6, 2016

Conversation

jemc
Copy link
Member

@jemc jemc commented Nov 6, 2016

This PR implements issue #1391 (RFC 24), changing the lambda syntax to be more concise, and more consistent with the "lambdatype" syntax, using curly braces as the bounds of the lambda.

Note that the implementation takes special care to give a convenient, comprehensible error message for the old lambda syntax, to try to make migration to the new syntax easier for people with existing codebases using the old syntax:

lambda ... end is no longer supported syntax; use {...} for lambdas
      lambda(s: String): String => s + " world" end
      ^

@jemc jemc assigned jemc and unassigned jemc Nov 6, 2016
@Praetonus
Copy link
Member

Shouldn't the old syntax still be part of the pony.g file? It seems to me that it always matches the output of ponyc --antlr.

@jemc
Copy link
Member Author

jemc commented Nov 6, 2016

@Praetonus I was under the impression that invalid syntax that gets weeded out at the syntax pass should not be included in the pony.g grammar. However, you're right, it matches the output of ponyc --antlr exactly.

So I added another commit where I regenerated pony.g with the following command:

ponyc --antlr > pony.g

@jemc jemc added the changelog - changed Automatically add "Changed" CHANGELOG entry on merge label Nov 6, 2016
@jemc jemc changed the title Change lambda literal syntax to be more concise (issue #1391) Changed lambda literal syntax to be more concise (issue #1391) Nov 6, 2016
@Theodus Theodus merged commit 997eb7f into master Nov 6, 2016
ponylang-main added a commit that referenced this pull request Nov 6, 2016
@jemc jemc deleted the feature/concise-lambda-syntax branch November 7, 2016 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - changed Automatically add "Changed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants