However, since require is a special form, it would be better if we could avoid sharing it and simply inline the string argument "foo" in each callsite. (The same sharing happens if we use the string "foo" in two places anywhere in the file.)
Is there a way to achieve this? If not, could some way to achieve this be added (perhaps overloading the meaning of Sys.opaque_identity when compiling to JS?)
Using
gen_js_api
, if we try to bindrequire
(from Node) withthe compiler shares the constants
"foo"
:However, since
require
is a special form, it would be better if we could avoid sharing it and simply inline the string argument"foo"
in each callsite. (The same sharing happens if we use the string"foo"
in two places anywhere in the file.)Is there a way to achieve this? If not, could some way to achieve this be added (perhaps overloading the meaning of
Sys.opaque_identity
when compiling to JS?)See https://github.com/LexiFi/gen_js_api/issues/66, https://github.com/LexiFi/gen_js_api/pull/68, and https://github.com/LexiFi/gen_js_api/pull/174 for some related background.