[MLton] Signatures and def-use information

Matthew Fluet fluet at tti-c.org
Fri Feb 9 13:32:19 PST 2007


Vesa Karvonen wrote:
> While browsing SML code, I'd like to be able to jump not just to the
> definition of a binding, but also to the specification(s) of the
> binding when such exist.  Also, being able to list all definitions of
> a spec would also be nice.  It seems like def-use processing is done
> after type-checking, so it should not be impossible to also keep
> the relevant information for linking definitions to specifications.

I think the def-use processing (or, at least matching uses to defs) is 
done as part of type-checking.  The processing of unused is done after 
type-checking.

You might be able to rig things in the signature matching code so that 
the type or variable that is matched in the signature constitutes a use 
of that type or variable at the signature.  I'm not sure if that would 
give you the reverse -- getting all of the definitions of a spec.

> I haven't yet looked at the code to figure out how to do this.
> Helpful pointers are welcome. :)

I believe that the Env.cut function is what performs the real signature 
matching.





More information about the MLton mailing list