-
Notifications
You must be signed in to change notification settings - Fork 23
Clarify rules for repeat macro #350
Copy link
Copy link
Open
Labels
specification 1.1Ion 1.1 specification workIon 1.1 specification work
Description
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
0here 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
0rather 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 be flex_uint::n?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
specification 1.1Ion 1.1 specification workIon 1.1 specification work
Type
Projects
Status
Todo