Sugar.Collect macro inside a Sequence causing error

2022-08-18 Thread PMunch
Yup, if you want them ordered. If not you could change the argument to collect. You don't need the semicolon at the end, but it doesn't do anything if you leave it in. The result is the same: `@[{"one": 1, "two": 2, "three": 3}, {"sun": 1, "mon": 2, "tue": 3, "wed": 4}]`

Sugar.Collect macro inside a Sequence causing error

2022-08-18 Thread mohan24
Ohh, now i got it my bad, so the code should be: import tables, sugar, sequtils, strutils let l = @[ {"one":1, "two":2, "three":3}.toOrderedTable, collect(OrderedTable, ( for (i, j) in zip("sun mon tue wed".split(" "), (1..4).toSeq): {i:j

Sugar.Collect macro inside a Sequence causing error

2022-08-17 Thread SolitudeSF
`toTable` makes `Table`, but `newOrderedTable` makes `OrderedTableRef`.

Sugar.Collect macro inside a Sequence causing error

2022-08-17 Thread mohan24
Hello, so i was recently trying to use sugar's collect macro inside a sequence, like this: import tables, sugar, sequtils, strutils let l = @[ {"one":1, "two":2, "three":3}.toTable, collect(newOrderedTable, ( for (i, j) in zip("sun mon tue wed".spl