I don't understand collect. Given
type BS8 = set[int8]
var S = collect(newSeq) :
for i in 0..2 : {} # how can specify which type of set, e.g. BS8, here?
Unfortunately this doesn't work
var S = collect(newSeq[BS8]) :
...
Thanks for a hint, Helmut this works as well:
import sugar
let s = collect(newSeq):
for i in 0..2: set[int8]({})
or
import sugar
let s = collect(newSeq):
for i in 0..2:
var x: set[int8]
# do some kind of operation on x
x
Wow I didn't know you could assign types like that.
That's not an assignment, it's just a regular type declaration. In this case it's just creating a shorthand for a longer type name, like a C typedef.