[MLton] 2004 bug reports

Stephen Weeks MLton@mlton.org
Sun, 18 Jan 2004 12:39:18 -0800


> I had to change the #!interpreter in the 'mlton' script to invoke bash2
> instead of my old bash, otherwise I get this error:
> 
> [root@spacebar /root]# mlton @MLton gc-summary -- test.sml
> /usr/local/bin/mlton: [: --: unary operator expected
> @MLton missing --

This is the same switch from bash 1.14 to 2.03, so someone would only
see this problem on a pre 7.0 redhat, right?  I'm not sure how to work
around this error.  Is the problem on line 19 or line 23 of the
script?  Can you look into the bash 1.14 man page and play around with
the script to see if you can localize/fix the problem?

> Error: raw-network.sml 63.18: function applied to incorrect argument
>    expects: [CharArray.array] * _
>    but got: [Unsafe.CharArray.array] * _
>    in: sys_gethostname (buf, 511)
> 
> The UNSAFE sig on the mlton page seems to indicate that these should be
> the same type. 

Yes, we missed some sharing constraints.  I've checked in a fix.  BTW,
since we now distribute the basis library sources with the MLton
package, you can apply patches to the basis library sitting on your
machine and have them take effect directly.

> (It would be nice if the UNSAFE_* sigs were included in the user
> guide; I don't know where else to find those.)

I've filled in the UNSAFE_* definitions in the user guide.

> I realize that the basis 1997 is now deprecated, but in that mode,
> LargeWord.toString apparently expects Word64.word even though the
> Word64 structure is not bound:
> 
> Warning: -basis is deprecated
> Error: compile.sml 54.17: function applied to incorrect argument
>    expects: [Word64.word]
>    but got: [word]
>    in: LargeWord.toString (Posix.Process.p  ...  Posix.ProcEnv.getpid ()))
> 
> (changed to Word64.toString)
> 
> Warning: -basis is deprecated
> Error: compile.sml 54.17: undefined structure Word64

I've now exported Word64 with -basis 1997.  But I'm not sure that
changing LargeWord.toString to Word64.toString would help.  The
problem is that pidToWord returns a SysWord.word, which is a 32 bit
word, while LargeWord is a 64 bit word.  I think the right fix is to
replace LargeWord.toString with SysWord.toString.

> I ran mlton on some of the TILT tests. Here's some bugs with the parser:
...
> The lex item after infix(r) should be DIGIT, not INT.
...
> mlton should all of the one-liners below. See the def'n page 12:
> 
>         "No datdesc, valdesc, or exdesc may describe true, false,
>          nil, ::, or ref."
...
> mlton is not good at detecting duplicates, except for pattern variables.

Thanks for all the bug reports.  MLton now correctly handles all your
examples.