It's pretty obvious that something like this should be illegal:
(:repeat -2 true)
Should this be allowed?
(:repeat 0 true)
My thoughts are...
It could be surprising either way.
We're specifically not trying to make sure the macro system is suitable for general purpose computing. Disallowing 0 here helps to make sure that you can't do something like (.if_none (.repeat (%x) '') "x is 0" "x is more than 0").
In some implementations, it may be easier to implement the repeat macro if we can just raise an error for 0 rather than potentially adding special logic to advance the reader appropriately when it is 0.
I'm inclined to say no.
Second question is should the n parameter be flex_uint::n?
It's pretty obvious that something like this should be illegal:
Should this be allowed?
My thoughts are...
0
here helps to make sure that you can't do something like(.if_none (.repeat (%x) '') "x is 0" "x is more than 0")
.0
rather than potentially adding special logic to advance the reader appropriately when it is0
.I'm inclined to say no.
Second question is should the
n
parameter beflex_uint::n
?