This works:
var counter = initCountTable[char]()
for v in counter.values:
echo v
Documentationation says toSeq() "transforms any iterator into a sequence" so I would except this to work:
var counter = initCountTable[char]()
echo toSeq(counter.values)
Can someone explain why compilation fails with Error: undeclared field: 'values'
This file compiles and executes as expected for me:
import tables, sequtils
var counter = initCountTable[char]()
echo toSeq(counter.values)
Not sure why it isn't working for you. What version of the Nim compiler are you using?You are right and I'm a fool for not providing the whole code. In my original code I imported nre and the following can be seen in the documentation for that library:
: If you love sequtils.toSeq we have bad news for you. This library doesn't work with it due to documented compiler limitations.
Thank you :)
sequtils.toSeq(...)
should work even with nre, or do import nre except toSeq