Ignore part of tuple without warnings

2021-01-23 Thread ynfle
I'm 99% sure `gensym` is short for "generated symbol". It refers to a symbol that was the end of it's "name" added to prevent collisions with other names because it was generated in a template or macro.

Ignore part of tuple without warnings

2021-01-23 Thread doofenstein
those terms and phrases come all directly from the Nim manual, that's why you probably see them a lot here

Ignore part of tuple without warnings

2021-01-23 Thread holgerschurig
> gensymmed Both you and ElegantBeef uses this term in a forum where a lot of newbie are in. Is it possible to sound less like a CS professor here? :-) I'm also quite sure not everyone knows "to maintain scope hygiene" is or means, or why one personally needs to care about it and this isn't som

Ignore part of tuple without warnings

2021-01-20 Thread Hlaaftana
Github issue:

Ignore part of tuple without warnings

2021-01-20 Thread ElegantBeef
Worth noting that `used` will cause issues if you have anymore than one `_` in the template as the compiler will assume they're all the same. [Used example](https://play.nim-lang.org/#ix=2MFl) [Inject example](https://play.nim-lang.org/#ix=2MFm)

Ignore part of tuple without warnings

2021-01-20 Thread lqdev
As far as I can tell from the gensyms, you're trying to do that in a template. Try adding a {.used.} pragma to your variable, like so: let (a {.used.}, b) = getATuple(sth) Run

Ignore part of tuple without warnings

2021-01-20 Thread drkameleon
Basically, I'm doing something simple: let (a,b) = getATuple(sth) Run Then I'm using just `b` and the compiler complains that: Hint: 'a`gensym452' is declared but not used [XDeclaredButNotUsed] Run Which sounds fine. Then I replace the par

Ignore part of tuple without warnings

2021-01-20 Thread drkameleon
Thanks a lot for the suggestions! Yes, it works beautifully! And yep, I have been using it in a template - [as @Araq had pointed out](https://forum.nim-lang.org/t/7337), I have _tons_ of them...

Ignore part of tuple without warnings

2021-01-20 Thread ElegantBeef
I wager you're using a template, those gensym the identifiers created inside them, so the way to stop that is using `{.inject.}` as the following. template test = let (a, _{.inject.}) = (100, 200) test() Run