Hi, I am just getting started with NIM ...
Q: How to I CONVERT a set -> string or array of string? ... is there a GENERIC method, which most object have ?
Q: Is there a way to find out the methods / variables of an object? ... eg. object .list ... similar to object.type
Thanks for any help / advise
Robert
For the first question I have no idea what you mean.
For the second, Nim has no classes, so there are no methods coupled closely to objects. But for the fields of objects, there are various fields and fieldPairs iterators, see
import sugar
let seto = {1, 2, 3}
let seqo = sugar.collect(newSeq):
for item in seto: $item
echo seqo
let seto = {1, 2, 3}
let seqo2 = block:
var lst: seq[string]
for item in seto: lst.add($item)
lst
echo seqo2
Theres also sequtils.toSeq. Depending the use case it can be improved for sure.
On Nim "methods" are like free floating functions, I dont think is possible to list all of them, because you can create custom ones, and theres functions that can take any or T, return auto, etc.
If you want like an index to see which functions are on stdlib available, then CTRL+F on https://nim-lang.github.io/Nim/theindex.html
How to I CONVERT a set -> string or array of string
If you mean like toString, the ` $ operator <https://nim-lang.org/docs/dollars.html>`_ is mainly used.