samedi 23 mai 2020

¿Why appear ML error in evaluating test file?

I have two elementary programs:

The first one is next (named funct.sml):

fun f(x,y) = x * y
fun double x = f(x,2)

In the second one I write some tests:

use "funct.sml"
val t1 = f(3,5) = 15
val t2 = double 6 = 12

when I write, on linux, sml < test.sml raise the error:

Standard ML of New Jersey v110.80 [built: Fri May 22 11:19:04 2020]
stdIn:2.2-2.8 Error: syntax error: deleting  VAL ID

running it on emacs show:

[opening test.sml]
test.sml:1.2-1.19 Error: syntax error: deleting  ID STRING

uncaught exception Compile [Compile: "syntax error"]
  raised at: ../compiler/Parse/main/smlfile.sml:15.24-15.46
             ../compiler/TopLevel/interact/evalloop.sml:42.54
             ../compiler/TopLevel/interact/evalloop.sml:299.20-299.23

these tests work fine making it directly on sml-mode for emacs, then I don't find where could be the error code.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire