[MLton] Char.scan
Matthew Fluet
fluet@cs.cornell.edu
Sun, 28 Dec 2003 17:59:58 -0500 (EST)
MLton currently disagrees with SML/NJ on Char.scan when encountering a ".
There was some discussion on the basis-library list, which ended with
Steve arguing:
> Progress. Here is my current understanding of the proposed changes
> and clarifications. I've added a couple of logical (I hope)
> consequences regarding Char.scan.
>
> 1. Char.scan returns NONE upon double quote.
> 2. String.scan stops upon double quote, and returns the output to that
> point.
> 3. String.scan consumes format sequences.
> 4. Char.scan consumes format sequences adjacent to a valid character.
> I mention this because of pathological character constants like
> #"a\ \", #"\ \a", #"\ \a\ \", and #"\ \\ \a".
> 5. Char.scan does not consume format sequences if it is unable to
> produce a character. Consider the invalid character constant
> #"\ \".
> 6. String.scan never returns NONE.
MLton currently disagrees with 1; I don't know about the other items. In
any case, this was (the only) show-stopper in compiling the ML-Doc tools
with MLton.
(There were a couple of or-patterns and vector literals that were trivial
to change. It was also a pain changing all the .cm files to not use CM
anchors; unfortunately, I can't figure out a way of configuring SML/NJ so
that CM.Graph.graph on "$/smlnj-lib.cm" gives useful results. The problem
is that all the anchored stuff is stabilized, so should be independent of
the sources. I got around it by replicating (part of) the SML/NJ source
tree, and replacing all the anchored references (in both the SML/NJ and
ML-Doc sources) with relative references. Then cmcat did it's thing.)