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

Mutually recursive functions #95

Closed
julianhyde opened this issue Jan 1, 2022 · 1 comment
Closed

Mutually recursive functions #95

julianhyde opened this issue Jan 1, 2022 · 1 comment

Comments

@julianhyde
Copy link
Collaborator

Morel should allow functions to refer to each other when declared using and. The following expression succeeds in Standard ML:

let
   fun half x = if x > 3 then (prev x) div 2 else x
   and prev x = if x > 10 then half (x - 3) else x
in
  half 14
end;                                                                                                                          =                           
val it = 1 : int

but in Morel it currently gives

unbound variable or constructor: prev
@julianhyde
Copy link
Collaborator Author

Fixed in 68b5221.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant