The SIP meeting notes (which, incidentally, are excellent!–I’m impressed by how many issues were discussed in that meeting, and appreciate how clear the write-up is!) from 2020-03-11 make this claim: "@infix
is uncontroversial".
Please note this discussion, which was full of controversy: The @infix Annotation
In particular, the primary argument in favor of @infix
is to increase regularity, but a case has been made that it will actually decrease regularity. There has been no clear argument that the original view is in fact correct!
It would be nice, if @infix
is going in, to have at least an official acknowledgement of the arguments against it. Better would be to make counterarguments, and argue against alternative proposals that claim they would better accomplish the same stated goal. (The people who argued in favor of @infix
did not, as far as I could tell, adequately address the criticisms.)
To summarize the long thread, the most weighty criticism to my eyes is the following:
@infix
encourages regularity in how a single library is used, but discourages regularity in code that consumes libraries, as there is no mechanism to force different library authors to make the same decision about which methods are infix. If, for instance, one library makes contains
infix and another doesn’t, you cannot adopt a consistent-with-the-library usage for contains
. Therefore, the effect of @infix
will not be, as it claims, to increase regularity, but actually to just decrease the usage of infix notation–it will always be bad practice to use something infix, even if it’s notated @infix
, because you never know when some other library will fail to use the annotation, and your code will be internally inconsistent in style.
It would be nice to have a clear, reasonable comprehensive, and decently compelling argument in favor of @infix
somewhere. Or, if deeper reflection suggests that the arguments against have sufficient merit, maybe the decision should be revisited.
It certainly shouldn’t just be classified as “oh, uncontroversial, so let’s do it”. If “uncontroversial” means only, “the people at this committee meeting all agree”, it’s kind of a shame that the people who believe this is a bad idea don’t have their position represented on the committee.