4 ms·
I believe the only time you have to name a tuple is when you define a tuple type. You can otherwise easily work with "anonymous" tuple fields. https://play.nim
by matthiaswh 5y ago
I believe the only time you have to name a tuple is when you define a tuple type. You can otherwise easily work with "anonymous" tuple fields.
https://play.nim-lang.org/#ix=2lK1 https://play.nim-lang.org/#ix=2lK1
Tuples with anonymous fields are equivalent to those with named fields as long as the types and values match. Two tuples with differently named fields will not be equivalent even if their values are.
> magically know the names of elements as well from returned tuples.
This is not magic, is it? No more so than knowing the return type.
- uryga 5y ago> https://play.nim-lang.org/#ix=2lK1 https://play.nim-lang.org/#ix=2lK1 which part of the link shows using tuples? i can't really see anything tuple-like really