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

More consistent let/letrec syntax #229

Closed
7 tasks done
rolyp opened this issue Oct 13, 2019 · 1 comment
Closed
7 tasks done

More consistent let/letrec syntax #229

rolyp opened this issue Oct 13, 2019 · 1 comment

Comments

@rolyp
Copy link
Collaborator

rolyp commented Oct 13, 2019

Drop the fun keyword from letrec, so we have:

letrec
   f x y → ...;
   g a b → ...

Then similarly generalise the let syntax, allowing:

let f x y → ...;
let g a b → ...

There is no case for having a letrec analogue of the “first-class function” notation for let, since that would suggest that arbitrary recursive values are permitted:

letrec 
   f = fun x y → ...;
   g = fun a b →

Experimented with desugaring into a syntax such as the above as part of #225. Also consider splitting letrec into two keywords, a la O'Caml.

  • traditional let x = e in e’ instead of prior "defs" approach , but write in as ;
  • let rec
    • drop rec, and assume all named functions recursive
    • modules as sequences of let and recursive let definitions
    • allow -> as well as = for consistency with other eliminator occurrences
    • allow blocks of recursive definitions
  • non-recursive (anonymous) functions
    • syntax, semantics and slicing
    • parsing
@rolyp
Copy link
Collaborator Author

rolyp commented Jun 1, 2020

Doing as part of #281.

@rolyp rolyp closed this as completed Jun 1, 2020
@rolyp rolyp reopened this Jun 1, 2020
@rolyp rolyp mentioned this issue Jun 1, 2020
86 tasks
@rolyp rolyp closed this as completed Jun 4, 2020
@rolyp rolyp mentioned this issue Jun 17, 2020
8 tasks
@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