Skip to content

Document %external(\"SomeValue") #351

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

Closed
kevanstannard opened this issue May 8, 2021 · 3 comments
Closed

Document %external(\"SomeValue") #351

kevanstannard opened this issue May 8, 2021 · 3 comments

Comments

@kevanstannard
Copy link
Contributor

kevanstannard commented May 8, 2021

We have %external documented on the Special Global Values but I'm not sure if we have the %external(\"SomeValue") syntax documented?

Just noticed this on a recent forum post.

I might have missed it in the docs, otherwise is this something we would like to document?

I am happy to contribute a PR if you think this is useful to document.

Thanks

@ryyppy
Copy link
Member

ryyppy commented May 10, 2021

Yeah as you already know, \"" is an escape hatch that can potentially break compiler invariants that hongbo is not too happy about, so we kinda don't advertise this "feature" too much.

Since this is probably very important for class feature detection, I think it would be fine to put another example in there, just like with the AudioContext example (maybe with a note that \"" syntax is an escape hatch to represent capitalized values in ReScript, that would otherwise collide with module / variant constructor names).

@kevanstannard
Copy link
Contributor Author

Ah, I see what you mean. I'll raise a PR and see what you think.

@kevanstannard
Copy link
Contributor Author

As discussed in the PR, %raw is preferred over %external so closing this issue.

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

Successfully merging a pull request may close this issue.

2 participants