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

Differentiate between fn (.) and fn(.()) #2357

Closed
bobzhang opened this issue Mar 22, 2019 · 1 comment
Closed

Differentiate between fn (.) and fn(.()) #2357

bobzhang opened this issue Mar 22, 2019 · 1 comment

Comments

@bobzhang
Copy link
Contributor

Relevant: rescript-lang/rescript#3429

Currently they are all de-sugared into OCaml syntax fn () [@bs]

The thing is that in BuckleScript, since there is no syntax space for arity zero, so we make a special form that fn () [@bs] is treated arity zero application.

I wonder Reason could make a difference here which feels more intuitive:

fn (.) --> arity zero -> fn () [@bs]
fn (. ()) --> arity 1 -> let unit = () in fn unit of course, some care need to be taken to avoid name collision

@anmonteiro
Copy link
Member

This would need to remain compatible with OCaml, and I don’t see a viable way to do that

@anmonteiro anmonteiro closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
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

2 participants