I'm seeing (with the version just after 1.33 on main) the error you mention on line 34:
var morebits : domain(string); // this is declaring an associative domain (kindof like a set)
// ...
for i in 0..morebits.size {
writeln(morebits[i]); // error: domain slice requires a range in at least one dimension
}
The issue is that morebits is a domain. While domains support slicing (with, say, another domain, to compute an intersection), they don't support element access. Here i is an int.
(That said, since morebits is an associative domain, you wouldn't be able to slice it with a range anyway, and so the error message is misleading).
Here it looks like your intention is to iterate over the indices in the domain and to print them out. You could use this loop to do so:
for i in morebits.sorted() {
writeln(i);
}
If you just use for in morebits it will work but you might see a different output ordering run-to-run, since the associative domain is supported by a hashtable. That is the reason I showed morebits.sorted() here.
I'm seeing (with the version just after 1.33 on main) the error you mention on line 34:
var morebits : domain(string); // this is declaring an associative domain (kindof like a set)
// ...
for i in 0..morebits.size {
writeln(morebits[i]); // error: domain slice requires a range in at least one dimension
}
The issue is that morebits is a domain. While domains support slicing (with, say, another domain, to compute an intersection), they don't support element access. Here i is an int.
(That said, since morebits is an associative domain, you wouldn't be able to slice it with a range anyway, and so the error message is misleading).
Here it looks like your intention is to iterate over the indices in the domain and to print them out. You could use this loop to do so:
for i in morebits.sorted() {
writeln(i);
}
If you just use for in morebits it will work but you might see a different output ordering run-to-run, since the associative domain is supported by a hashtable. That is the reason I
showed morebits.sorted() here.