caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Benoit de Boursetty <debourse@email.enst.fr>
To: skaller <skaller@maxtal.com.au>
Cc: caml-list@inria.fr, Pierre.Weis@inria.fr,
	caml-redistribution@pauillac.inria.fr
Subject: Re: What is this?
Date: Wed, 17 Nov 1999 10:46:35 +0100 (MET)	[thread overview]
Message-ID: <Pine.GSO.4.02.9911171043330.22861-100000@pascal.enst.fr> (raw)
In-Reply-To: <3830BAC4.BBA190F7@maxtal.com.au>

On Tue, 16 Nov 1999, skaller wrote:

> Can anyone see this error?
> --------------------------------------------------------
> File "py_interp.ml", line 477, characters 6-545:
> This expression has type int but is here used with type unit
> ---------------------------------------------------------
> [exception SystemExit of int]
> .....
>
>   method run_file filename : int >       try
>         ignore (environment # set_attr (PyString "__name__") (PyString
> "__main__"));
>         ignore (environment # set_attr (PyString "__file__") (PyString
> filename));
>         Py_exec_module.exec_file (self:>interpreter_t)
>           (Py_exec.py_exec (self:>interpreter_t)
> (environment:>environment_t))
>           filename
>         ;
>         0
>       with
>       | SystemExit n -> n
>       | x ->
>         print_endline ("Error Near line " ^ (string_of_int (fst
> source_reference)));
>         flush stdout;
>         self#py_raise x;
>         0 (* dummy value *)
>
> -------------------------------------------------------
>
> This method is NOT called anywhere in the module.
> I cannot see where the inference engine gets the
> idea that the expression should have type unit.
>
>
> [That message is really annoying. It should read
> " .. but is used _somewhere else_ with type .."
> since it always means that. It would be nice
> to know where that somewhere else is, since half the
> time, that is where the error is]

I can't see the error, but I suggest you comment out most of the code. If
you begin with

 try
   0
 with SystemExit n -> n
  | x -> 0

and uncomment things afterwards, you can find where the problem is by
dichotomy. Since you have 6 lines of code, it shouldn't take you more than
3 tries :)

Benoît de Boursetty.




      parent reply	other threads:[~1999-11-17  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-16  2:00 skaller
1999-11-16 23:13 ` skaller
1999-11-17  9:46 ` Benoit de Boursetty [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.02.9911171043330.22861-100000@pascal.enst.fr \
    --to=debourse@email.enst.fr \
    --cc=Benoit.de-Boursetty@polytechnique.org \
    --cc=Pierre.Weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=caml-redistribution@pauillac.inria.fr \
    --cc=skaller@maxtal.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).