caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: ls-ocaml-developer-2006@m-e-leypold.de
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Exception Unix_error problem in toplevel
Date: Sun, 04 Feb 2007 11:46:55 +0100	[thread overview]
Message-ID: <ylsldmurmo.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: <20070204004610.GB30621@telus.net> (Bob Williams's message of "Sat, 3 Feb 2007 16:46:10 -0800")



Bob Williams <a6b37331@telus.net> writes:

> On Sat, Feb 03, 2007 at 02:48:30PM +0100, ls-ocaml-developer-2006@m-e-leypold.de wrote:
>> 
>> Bob Williams <a6b37331@telus.net> writes:
>> 
>> > Now to the possible bug in toplevel.  According to section 6.8.2 of
>> > the OCaml manual,
>> >
>> > 	exception Unix_error of ...
>> >
>> > simply declares another variant of the built-in variant type "exn".  I
>> > haven't looked into the implementation of OCaml, but I assume the
>> > compiler statically assigns a tag number to every variant of a normal
>> > variant type.  For exn, however, the tag numbers must be assigned at
>> > load time or run time.
>> >
>> > And that is the problem I stumbled over.  The second copy of
>> 
>> Oh cool. :-). There should be RAQ (rarely asked questions + obscure
>> problems). This should go into it :-).
>> 
>> Regards -- Markus
>
> They are all obscure, Markus.  A careful developer finds and fixes
> most of the obvious bugs; the ones left over are nearly always
> unusual.
>
> I did something stupid to trigger the exception-renumbering bug, but


But if I understood it right, it's not a bug, but rather a user
error. There is AFAIR a FAQ for a similar situation if people
interactively load byte code files several times and define functions
in between. Your problem is similar, only that you're not redefining
functions but rather execptions.

I also think redefining an exception should not trigger an error or
warning message.

Rather reloading a byte code file of the same name and at the same
time having still loaded byte code files that refer to another version
of the first byte code file -- this should trigger an error or a
warning. Reloading a byte code file to which no other definitions
refer is not a problem and indeed wanted when you do debugging.

> there are valid circumstances under which the bug could bite somebody
> else.  So it should probably be fixed.


> I know almost nothing about OCaml's implementation, so any patch I
> contribute will probably hurt more than it will help.  But if nobody
> volunteers to fix the bug, I hereby threaten to do it myself.  :)

Regards -- Markus


  reply	other threads:[~2007-02-04 10:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02  1:10 Bob Williams
2007-02-02 12:08 ` [Caml-list] " ls-ocaml-developer-2006
2007-02-02 13:21   ` Luc Maranget
2007-02-03  2:29   ` Bob Williams
2007-02-03  9:57     ` Gabriel Kerneis
2007-02-04  0:34       ` Bob Williams
2007-02-03 13:48     ` ls-ocaml-developer-2006
2007-02-04  0:46       ` Bob Williams
2007-02-04 10:46         ` ls-ocaml-developer-2006 [this message]
2007-02-06  7:20           ` Bob Williams
2007-02-02 13:13 ` Vu Ngoc San

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=ylsldmurmo.fsf@hod.lan.m-e-leypold.de \
    --to=ls-ocaml-developer-2006@m-e-leypold.de \
    --cc=caml-list@yquem.inria.fr \
    /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).