[MLton] Ad-hoc infix identifiers, Printf, and libraries

Andreas Rossberg rossberg@ps.uni-sb.de
Thu, 14 Jul 2005 19:27:46 +0200


Vesa Karvonen wrote:
> 
> I'm not exactly sure what you have in mind.

Consider library A defining operators P, Q, R, and library B defining 
operators U, V, W. I can only specify the relative precedences of 
operators within one of the libraries. I cannot specify any 
inter-library precedences without creating a dependency between the 
libraries. Still such precedences might be useful.

> One could, for example, introduce virtual or place-holder operators for
> making it easier to combine groups of precedences.  Basically, a library
> would introduce fixity declarations that are only used for the purpose of
> allowing users to declare precedences relative to the actual operators
> in the library robustly and conveniently.

OK, but that would either restrict inter-library precedences to a set of 
dummy operators pre-defined globally, or require intervention on part of 
the user of the libraries. Both does not make it significantly more 
attractive than what you have with absolute numeric precedences. What if 
I want P<U<V<Q<W<R? If we really intend to make non-trivial use of infix 
(which seems the whole point of the discussion) that may not be an 
unsensible desire.

I guess my point is that your proposal, while looking neat, still does 
not provide a general solution, it may even be less convenient in cases, 
and hence may not be worth the complication. I have people seen 
suggesting real-valued precedences - that seems more powerful, but also 
pretty crazy...

> But this is probably getting off-topic...

Agreed. :-)

   - Andreas

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

Let's get rid of those possible thingies!  -- TB