Code Comments
Programming Forum and web based access to our favorite programming groups.I've got a problem with my SMLNJ installation. Whenever I start an sml process (through Emacs or from the command line), I run the following program to make sure that values are printed 'properly': structure AdjustPrinter = struct val _ = Compiler.Control.Print.printDepth := 100 val _ = Compiler.Control.Print.printLength := 100 end When running SMLNJ v110.62 or v110.67 under Kubuntu, I get the following error message: /home/cnn/.emacs.d/print.sml:5.13-5.46 Error: unbound structure: Control in path Compiler.Control.Print.printDepth /home/cnn/.emacs.d/print.sml:6.13-6.47 Error: unbound structure: Control in path Compiler.Control.Print.printLength At my school, where I'm running SMLNJ v110.0.6, it works fine. Anyone know why? -- /Jacob Johannsen aka CNN -------------------------------------------------------------------------- NOW IS NOT THE TIME TO ASK FOR A LAVA LAMP!!! --------------------------------------------------------------------------
Post Follow-up to this messageJacob Johannsen <cnn@daimi.au.dk> writes: > I've got a problem with my SMLNJ installation. > > Whenever I start an sml process (through Emacs or from the command > line), I run the following program to make sure that values are > printed 'properly': > > structure AdjustPrinter > = struct > val _ = Compiler.Control.Print.printDepth := 100 > val _ = Compiler.Control.Print.printLength := 100 > end > > When running SMLNJ v110.62 or v110.67 under Kubuntu, I get the > following error message: > > /home/cnn/.emacs.d/print.sml:5.13-5.46 Error: unbound structure: > Control in path Compiler.Control.Print.printDepth > /home/cnn/.emacs.d/print.sml:6.13-6.47 Error: unbound structure: > Control in path Compiler.Control.Print.printLength > > At my school, where I'm running SMLNJ v110.0.6, it works fine. Anyone > know why? Yes, I do. Structure Control is now a toplevel structure. It is exported from library $smlnj/compiler.cm. (This library is already available at the interactive loop. But if you want to use structure Control within one of your CM-managed programs, you will need to add $smlnj/compiler.cm to you projects .cm-file.) Matthias
Post Follow-up to this messageMatthias Blume <find@my.address.elsewhere> writes: [snip] > Yes, I do. Structure Control is now a toplevel structure. It is > exported from library $smlnj/compiler.cm. (This library is already > available at the interactive loop. But if you want to use structure > Control within one of your CM-managed programs, you will need to add > $smlnj/compiler.cm to you projects .cm-file.) > Problem fixed, thanks. Another problem, though: When I send an illegal SML program to the interactive loop through Emacs, I get the corresponding error message. However, after the error message, I get the following: uncaught exception Error raised at: ../compiler/TopLevel/interact/evalloop.sml:63.48-63.56 ./compiler/TopLevel/interact/evalloop.sml:44.55 ./compiler/TopLevel/interact/evalloop.sml:291.17-291.20 This is just noise, and I'd like to get rid of it. Anyone know how to do that? When running the interactive loop from the command prompt, the problem doesn't exist. -- /Jacob Johannsen aka CNN -------------------------------------------------------------------------- NOW IS NOT THE TIME TO ASK FOR A LAVA LAMP!!! --------------------------------------------------------------------------
Post Follow-up to this message> uncaught exception Error > raised at: ../compiler/TopLevel/interact/evalloop.sml:63.48-63.56 > ../compiler/TopLevel/interact/evalloop.sml:44.55 > ../compiler/TopLevel/interact/evalloop.sml:291.17-291.20 > > This is just noise, and I'd like to get rid of it. Anyone know how to > do that? Why not use an emacs script to eat it up?
Post Follow-up to this messageJacob Johannsen <cnn@daimi.au.dk> writes: > Matthias Blume <find@my.address.elsewhere> writes: > > [snip] > > Problem fixed, thanks. > > Another problem, though: > > When I send an illegal SML program to the interactive loop through > Emacs, I get the corresponding error message. However, after the error > message, I get the following: > > uncaught exception Error > raised at: ../compiler/TopLevel/interact/evalloop.sml:63.48-63.56 > ../compiler/TopLevel/interact/evalloop.sml:44.55 > ../compiler/TopLevel/interact/evalloop.sml:291.17-291.20 > > This is just noise, and I'd like to get rid of it. Anyone know how to > do that? Can you give me some additional details on what you are doing? Here is a verbatim cut&paste from an Emacs session that I just ran: ----- Standard ML of New Jersey v110.67 [built: Thu Feb 28 11:09:14 2008] - 1+"2"; stdIn:1.1-1.6 Error: operator and operand don't agree [literal] operator domain: int * int operand: int * string in expression: 1 + "2" - raise Fail "error"; stdIn:1.1-1.19 Warning: type vars not generalized because of value restriction are instantiated to dummy types (X1,X2,...) uncaught exception Fail [Fail: error] raised at: stdIn:1.7-1.19 - exception Error; exception Error - raise Error; stdIn:2.1-2.12 Warning: type vars not generalized because of value restriction are instantiated to dummy types (X1,X2,...) uncaught exception Error raised at: stdIn:2.7-2.12 - ----- As you can see, there aren't any of those noisy lines that you mention... How did you run sml under emacs? Matthias
Post Follow-up to this message"Matthias.Blume@gmail.com" <Matthias.Blume@gmail.com> writes: > Jacob Johannsen <cnn@daimi.au.dk> writes: [snip] > > Can you give me some additional details on what you are doing? Here > is a verbatim cut&paste from an Emacs session that I just ran: > > ----- > Standard ML of New Jersey v110.67 [built: Thu Feb 28 11:09:14 2008] > - 1+"2"; > stdIn:1.1-1.6 Error: operator and operand don't agree [literal] > operator domain: int * int > operand: int * string > in expression: > 1 + "2" > - raise Fail "error"; > stdIn:1.1-1.19 Warning: type vars not generalized because of > value restriction are instantiated to dummy types (X1,X2,...) > > uncaught exception Fail [Fail: error] > raised at: stdIn:1.7-1.19 > - exception Error; > exception Error > - raise Error; > stdIn:2.1-2.12 Warning: type vars not generalized because of > value restriction are instantiated to dummy types (X1,X2,...) > > uncaught exception Error > raised at: stdIn:2.7-2.12 > - > ----- > > As you can see, there aren't any of those noisy lines that you > mention... > > How did you run sml under emacs? My sml-mode sends the contents of the current buffer to the interactive process by creating a temporary file and executing - use <temporary file>; in the interactive loop. The problem seems to happen only when executing 'use' on a file containing an illegal program (bla.sml contains the expression 1+"2"): - 1+"2"; stdIn:2.1-2.6 Error: operator and operand don't agree [literal] operator domain: int * int operand: int * string in expression: 1 + "2" - use "/home/cnn/tmp/bla.sml"; [opening /home/cnn/tmp/bla.sml] /home/cnn/tmp/bla.sml:1.1-1.6 Error: operator and operand don't agree [literal] operator domain: int * int operand: int * string in expression: 1 + "2" uncaught exception Error raised at: ../compiler/TopLevel/interact/evalloop.sml:63.48-63.56 ./compiler/TopLevel/interact/evalloop.sml:44.55 ./compiler/TopLevel/interact/evalloop.sml:291.17-291.20 - The exact same thing happens when I run sml from the command line, so it doesn't look like an Emacs problem. -- /Jacob Johannsen aka CNN -------------------------------------------------------------------------- NOW IS NOT THE TIME TO ASK FOR A LAVA LAMP!!! --------------------------------------------------------------------------
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.