[MLton-devel] front-end and deprecated identifiers
Stephen Weeks
MLton@mlton.org
Tue, 2 Sep 2003 11:30:47 -0700
> Anyways, I was wondering how difficult it would be to modify the
> front-end and elaborator to emit warnings on uses of deprecated
> identifiers. (The "opposite" would be nice to; if an identifier is
> added to a module, you can get unwanted uses through open S.)
The closest thing that we have right now is -show-basis-used, which
shows the longids used by the program. It works by keeping a bool ref
associated with each longid in the environment and setting the bool
ref to true when a longid is looked up.
I'm not sure if the easiest way to do what you want is to modify the
syntax and propagate info through the front end. It might be easier
to simply have a list of deprecated longids in a file somewhere
Word.fromLargeWord
Word.toLargeWord
...
Then, tweak main/compile.sml so that after the program is elaborated,
look at each longid from the basis that is used and see if it is in
the file. With this approach, we only need to add a slightly more
general function than we have now to Elaborate.Env
foreachUsed: t * (Longid.t -> unit) -> unit
Or possibly even foldUsed, which should be an easy generalization of
the layoutUsed that is currently there.
If you wanna give it a try, go for it.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel