[MLton-user] Re: Syntax error: replacing WILD with ASTERISK.

Matthew Fluet matthew.fluet at gmail.com
Tue Jun 29 10:10:29 PDT 2010


On Tue, Jun 29, 2010 at 6:08 AM, Michel Barakat <bmichel at gmail.com> wrote:
> * Context: moving old code which uses MLton to an amd64 machine.
> - Moved from MLton 20041109 to MLton 20070826 because:
> -- no amd64 support in MLton 20041109

> -- looks for " /usr/lib/mlton/world.mlton ". Couldn't find it's
> equivalent in the latest release MLton 20100608.

Correct.  MLton 20100608 does not use a world file.

> - Wasn't picking up the SML_LIB variable. Fixed by specifying the "
> -mlb-path-map " manually.

Not sure what you mean by this.  That MLton 20100608 doesn't properly
define "SML_LIB" or that MLton 20041109 doesn't properly define
"SML_LIB"?

> * Compiler options:
> " /usr/lib/mlton/mlton-compile @MLton load-world
> /usr/lib/mlton/world.mlton ram-slop 0.5  fixed-heap 1200m --
> /usr/lib/mlton -cc gcc -cc-opt -I/usr/lib/mlton/include -cc-opt -O1
> -cc-opt -fno-strict-aliasing -fomit-frame-pointer -w -target-cc-opt
> x86 -fno-strength-reduce
>                -fschedule-insns
>                -fschedule-insns2
>                -malign-functions=5
>                -malign-jumps=2
>                -malign-loops=2
>                -mcpu=pentiumpro -target-cc-opt sparc -Wa,-xarch=v8plusa
>                -fcall-used-g5
>                -fcall-used-g7
>                -m32
>                -mv8
>                -mcpu=ultrasparc -target-link-opt amd64 -L/usr/local/lib/ -lgmp
> -target-link-opt cygwin -lgmp -target-link-opt darwin -lgmp
> -target-link-opt freebsd -L/usr/local/lib/ -lgmp -target-link-opt
> mingw -lgmp -lws2_32 -lkernel32 -lpsapi -lnetapi32 -target-link-opt
> netbsd -Wl,-R/usr/pkg/lib -L/usr/local/lib/ -lgmp -target-link-opt
> openbsd -L/usr/local/lib/ -lgmp -target-link-opt solaris -lgmp -lnsl
> -lsocket -link-opt -lgdtoa -lm -runtime ram-slop 0.3 -default-ann
> allowFFI true -mlb-path-map /usr/lib/mlton/mlb-path-map -link-opt
> -static -const Exn.keepHistory true main.sml
> /home/michel/adate/bin/execute.c "

You shouldn't need to specify this whole compile line.  Just use
/usr/bin/mlton, to which you can pass the additional options, which
appear to be "-runtime 'ram-slop 0.3' -default-ann 'allowFFI true'
-link-opt static -const 'Exn.keepHistory true'".

> * Problem
> I'm facing the following error message when compiling:
> " Error: main.sml 4.15.
>  Syntax error: replacing  WILD with  ASTERISK.
> [...]
>  Parse error.
> compilation aborted: parseAndElaborate reported errors "
>
> Investigating main.sml reveals the error is happening at the _ffi
> calls, for example:
> " val HATCHET = _ffi "c_fun_heap_size" : unit -> int; "

The "_ffi" syntax was deprecated with MLton 20041109; you should be
getting warnings of the form "_ffi is deprecated.  Use _import." when
compiling with MLton 20041109.  As noted in the warning message, the
solution to replace uses of "_ffi" with "_import".



More information about the MLton-user mailing list