Format exception SML

308 views Asked by At

I'm using Linux Mint 17 and I recently installed smlnj (Standard ML of New Jersey) and sml-mode for Emacs with apt-get.

When I try to increase the print depth with the command Control.Print.PrintDepth := 100; I get the following error:

- Control.Print.PrintDepth := 100;
[autoloading]
[library $smlnj/compiler/current.cm is stable]
[library $smlnj/compiler/x86.cm is stable]
[library $smlnj/viscomp/core.cm is stable]
[library $smlnj/viscomp/basics.cm is stable]
[library $smlnj/viscomp/elabdata.cm is stable]
[library $smlnj/viscomp/elaborate.cm is stable]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $smlnj/viscomp/debugprof.cm is stable]
 Error: (stable) $smlnj/smlnj-lib/smlnj-lib.cm: unable to find $SMLNJ-LIB/Util/smlnj-lib.cm (/build/buildd/smlnj-110.76/sml.boot.x86-unix/SMLNJ-LIB/Util/smlnj-lib.cm)

unexpected exception (bug?) in SML/NJ: Format [Format]
  raised at: ../cm/stable/stabilize.sml:257.15-257.21
         ../cm/stable/stabilize.sml:360.44
         ../compiler/TopLevel/interact/evalloop.sml:44.55

I googled it but did not find anything.. Does anyone have an idea what this error could mean and how to fix it?

EDIT: I also tried the command with small p as Gergely suggested but it made no difference. I still get the same output:

- Control.Print.printDepth := 100;
[autoloading]
[library $smlnj/compiler/current.cm is stable]
... 
[library $smlnj/viscomp/debugprof.cm is stable]
 Error: (stable) $smlnj/smlnj-lib/smlnj-lib.cm: unable to find $SMLNJ-LIB/Util/smlnj-lib.cm (/build/buildd/smlnj-110.76/sml.boot.x86-unix/SMLNJ-LIB/Util/smlnj-lib.cm)

unexpected exception (bug?) in SML/NJ: Format [Format]
  raised at: ../cm/stable/stabilize.sml:257.15-257.21
             ../cm/stable/stabilize.sml:360.44
             ../compiler/TopLevel/interact/evalloop.sml:44.55

I also get the same error if I type open Control.Print; in REPL as Gergely did.

I also tried to build smlnj from source, but Emacs doesn't recognize it - when I try to load .sml file to REPL with Emacs keyboard shortcut C-c C-l, it complaints that it can't find sml command.

Thanks, Špela

2

There are 2 answers

0
Liz On BEST ANSWER

SOLVED. I needed to install additional package libsmlnj-smlnj which is also available with apt-get. It solved my problem.

Thanks for help, Špela.

0
Gergely On

I do not have Linux Mint but try to open the structure Control.Print:

- open Control.Print;
opening Control.Print
  val printDepth : int ref
  val printLength : int ref
  val stringDepth : int ref
  val intinfDepth : int ref
  val printLoop : bool ref
  val signatures : int ref
  val printOpens : bool ref
  val out : {flush:unit -> unit, say:string -> unit} ref
  val linewidth : int ref
  val say : string -> unit
  val flush : unit -> unit

as you can spot, the sought function name is printDepth, with small p.

I installed the latest SML/NJ, version 110.77. It took five minutes, I recommend to build it from source:

http://smlnj.org/dist/working/110.77/NOTES/INSTALL

section 1.