ion-docs icon indicating copy to clipboard operation
ion-docs copied to clipboard

Clarify cardinality rules around simple macro-typed parameters

Open toddjonker opened this issue 1 year ago • 0 comments

          > Macro types are significantly different from the other types. Assuming we add return-type specifiers (it's been accepted in concept but not written up), the modifier here is effectively double-bookkeeping that information (AFAICT). So I fret that the modifier will be frequently forgotten (the author knows that foo returns multiple values), to later surprise. I fret that foo* would be misinterpreted by non-authors to mean multiple foos are accepted.

I'm ok with this in principle, but I think we need to be more explicit about that special behavior. Specifically, I think we need a section describing (or a TODO) how macro shapes with non-unary expansions work. Otherwise this:

Simple tagless params (including macros) can only use ?, since there's no way to encode more than one value.

is misleading as a macro can produce more than one value. The situation with ? is potentially confusing too; a macro can expand to -> int?--do I still put ? on the param signature?

Originally posted by @zslayton in https://github.com/amazon-ion/ion-docs/issues/240#issuecomment-1581446906

toddjonker avatar Jun 07 '23 20:06 toddjonker