-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
genSym'ed proc name + exportc = invalid code #20911
Comments
What should be done? |
Not sure, my use case is that I don't care about the proc name, I just want to save it somewhere to be able to call it |
Well since you export the name, you cannot leave the name to the compiler. |
The compiler can generate whatever it wants, as long as I can retrieve its final form in the macro & it's valid |
Why do you use |
I use a system which can call a C procedure if I give it the procedure name. macro spawn(body: untyped) =
let
name = genSym(nskProc)
prc = newProc(name, body = body)
prc.addPragma(newIdentNode("exportc"))
newStmtList(
prc,
newCall("magicCaller", newStrLitNode(name.strVal))
)
spawn: echo "heya" So I don't care about the name, I just need to be able to give it to the |
What happened?
Nim Version
devel
d73fff1
Current Standard Output Logs
Expected Standard Output Logs
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: