-
-
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 vars now use X__gensymY instead of X`gensymY #19636
Conversation
Why not |
Because it affects the size of the generated C code and compile-times are never fast enough. |
It seems that https://github.com/iffy/nim-argparse is broken because it uses the internal implementation of if "`gensym" in node.strVal:
return ident(node.strVal.split("`")[0]) |
Should I use |
Looking at the patch I don't like the solution anymore. We need to find a better way. |
var isGenSym = false | ||
while alen > 1: | ||
if a[alen] == '_': | ||
if a[alen-1] == '_': | ||
dec alen | ||
isGenSym = true | ||
break | ||
else: | ||
dec(alen, 2) | ||
else: | ||
dec alen | ||
if not isGenSym: alen = a.len |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this should work too
let alen = rfind(a, "__")
if alen < 0:
alen = a.len
close #17304