[MLton-devel] new basis library

Stephen Weeks MLton@mlton.org
Sun, 28 Jul 2002 18:36:22 -0700


> On the down side, this has completely trashed check-basis.  The problem is
> that SML/NJ continues to interpret string constants as it's primitive
> string type, not as our char vector.  The solution should be fairly
> straightforward, I would think: add
> STRING_CONST (x:string) : char vector = raise (Fail "<string const>")
> to the top of the built basis.sml and wrap every string constant in the
> basis with STRING_CONST.  Unfortunately, that's not the simplest of
> reg-exps to write -- we need something that doesn't match character
> constants, but does match string constants with possibly escaped quotation
> marks. 

Another option is to put in the calls to STRING_CONST (or something
slightly less bold) by hand into the library source.

% grep '"' basis.sml | grep -v PRIM | grep -v '#line' | wc -l
385

385 as an upper bound.  Not too bad.

Another option would be to implement (part of) check-basis in a
better language that has a nice regexp library :-).

> And, the above switch doesn't work for string constants used in
> pattern matches, but I didn't see any in my perusal of the basis
> library and they would be easy enough to desugar if need be.

I saw a few in system/path.sml.

> Oh yeah, the other problem is that we don't want to replace the string
> literals that appear in #line directives.

That's easy, just do it in the script before these are inserted.


-------------------------------------------------------
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