amazon-ion / ion-docs

Source for the GitHub Pages for Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
23 stars 23 forks source link

Clarify rules for repeat macro #350

Open popematt opened 1 month ago

popematt commented 1 month ago

It's pretty obvious that something like this should be illegal:

(:repeat -2 true)

Should this be allowed?

(:repeat 0 true)

My thoughts are...

I'm inclined to say no.

Second question is should the n parameter be flex_uint::n?

popematt commented 4 days ago

In https://github.com/amazon-ion/ion-tests/pull/133, we decided that a repeat of 0 is allowed, and confirmed that repeating an empty stream is also allowed.