Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improved let syntax #355

Closed
8 tasks done
rolyp opened this issue Jun 17, 2020 · 0 comments
Closed
8 tasks done

Improved let syntax #355

rolyp opened this issue Jun 17, 2020 · 0 comments
Assignees

Comments

@rolyp
Copy link
Collaborator

rolyp commented Jun 17, 2020

Following on from #229, we should probably make some effort to make the let and recursive let syntax more familar. We should be able to support:

  • nested let for the non-recursive form as well as the recursive form, so we can write let x = 5; y = 6; ... – although one challenge here is that it will not be obvious why you can’t add a recursive definition to such a block, but instead have to start a new (recursive) let block (we could reintroduce the rec keyword to make this explicit)
    • in “modules”
    • in let expressions
  • in as the delimiter in expressions
  • but not in “pretend modules”
    • replace many by sepBy and some by SepBy1, turning semicolon into delimiter rather than terminator – needs sepBy1_try
    • in to separate list of defs from expr in defsExpr
    • semicolon to terminate list of defs in module – needs sepBy_try
  • replace letDefs and recDefs parser by new defsExpr parser, which folds a list of variable and function definitions and a terminal expression into a tree of Let or LetRec expressions
  • keyword “blah” should be a fatal error if “blah” is not a keyword

None of this is as straightforward as one would like, though, especially if both familiarity and non-verbosity are desiderata.

@rolyp rolyp self-assigned this Jun 17, 2020
@rolyp rolyp closed this as completed Jun 25, 2020
@rolyp rolyp added this to the v0.4: POPL 2022 milestone Nov 3, 2021
@rolyp rolyp added this to Fluid Jun 30, 2022
@rolyp rolyp moved this to Done in Fluid Jun 30, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant