[MLton-devel] Fwd: Mark Tuttle
Stephen Weeks
MLton@mlton.org
Thu, 1 May 2003 11:13:59 -0700
> 1. Use ml-lex and ml-yacc that come with smlnj to do my parsing,
> instead of using mllex and mlyacc with mlton, to avoid rewriting the
> .lex and .grm files for yet another lex/yacc tool.
>
> 2. Steal the HashTable implementation from smlnj.
I can answer these.
> 3.1. BinIO is missing setPosOut, and BinIO.StreamIO is missing
> flushOut and getWriter,
Matthew, it looks to me like these three functions are there in the
new layered IO implementation. I just checked in a few minor changes
to signatures to make them available. With those changes, the
following program at least works.
------------------------------------------------------------
structure Word8Vector =
struct
open Word8Vector
fun fromString s =
tabulate (String.size s, fn i =>
Byte.charToByte (String.sub (s, i)))
end
val out = BinIO.openOut "/tmp/z.binio"
val pos = BinIO.getPosOut out
val _ = BinIO.output (out, Word8Vector.fromString "abc")
val _ = BinIO.setPosOut (out, pos)
val _ = BinIO.output (out, Word8Vector.fromString "def")
val _ = BinIO.closeOut out
------------------------------------------------------------
> I just need to write a 4G file, then write a few characters to the
> head of the file. Is there an easy solution more efficient than a
> massive disk file copy?
I'm more worried about this. Won't we fail on files longer than 2G
due to 32 bit signed ints?
> 3.2. TextIO is missing openString. I could write the string to a
> disk file and open the disk file, but is there a better way?
TextIO.openString also appears to be supported by the new TextIO.
I've checked in a few changes to switch to it.
Is there any reason why we shouldn't package a MLton with the new IO
libraries and these changes so that these guys can try it out?
> 3.3. mlton does not appear to support antiquoting. I can define an
> 'a frag datatype, and use the QUOTE and ANTIQUOTE constructors
> explicitly, but is there a better way? Will there ever be support for
> the quasi-quoting notation?
Here I don't know what to say other than that there not there and we
don't have plans to add them. Thoughts?
-------------------------------------------------------
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