While working on #19, the error traces pointed out that the Process.spawn function was shadowing Erlang's spawn. This can be overcomed with a compiler directive, which we can't write at the moment, such as -compile({no_auto_import, [spawn/1]})..
Allowing these compiler directives is useful for:
redefining functions with standard names
allowing NIF on_load functions to be defined
adding more module-level attributes such as author or vsn
One way to fix this is to just use the compiler annotations where we can embed a string of raw Erlang, parse it, and merge it with the translated AST.
While working on #19, the error traces pointed out that the
Process.spawn
function was shadowing Erlang'sspawn
. This can be overcomed with a compiler directive, which we can't write at the moment, such as-compile({no_auto_import, [spawn/1]}).
.Allowing these compiler directives is useful for:
on_load
functions to be definedauthor
orvsn
One way to fix this is to just use the compiler annotations where we can embed a string of raw Erlang, parse it, and merge it with the translated AST.
Definitely not pretty, but should be enough to unblock this while we figure out what the proper syntax for this is. Another alternative would be:
but building a DSL for this feels like a lot more work right now.