Predefined nfx considered harmful
David A. Wheeler 04 Sep 2012 02:10 UTC
The current SRFI-105 updated draft says:
> An implementation <em>must not</em>, by default, bind the symbol
“<var>nfx</var>” to a procedure, macro, or syntax
that <em>cannot</em> be overridden."
I'm thinking that perhaps it should stronger, e.g., that the default environment shouldn't bind the symbol (or if it does, bind it to something that always produces an error/raises an exception).
If anyone wrote code that depended on some local implementation of nfx, then by *definition* it would become implementation-dependent. Yet the point of the "nfx" macro is to allow application authors the ability to *control* what to do in that case, not to make them unwittingly dependent on an implementation.
Of course, an implementation could provide a pre-canned macro that could be used as a definition of nfx. But then pulling in that library would be an explicit act, easily seen in the code, instead of being hidden. I don't object to implementation-defined procedures.. but it should be easy to find when they're being used.
Comments?
--- David A. Wheeler