caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Keiko Nakata <keiko@kurims.kyoto-u.ac.jp>
To: titmarc@free.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Bug in ocamlc or in ocamlrun.
Date: Wed, 19 Apr 2006 17:45:23 +0900 (JST)	[thread overview]
Message-ID: <20060419.174523.68533574.keiko@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <4445734B.6030004@free.fr>

From: Marc Lasson <titmarc@free.fr>
Subject: [Caml-list] Bug in ocamlc or in ocamlrun.
Date: Wed, 19 Apr 2006 01:16:27 +0200

> When i compile the following program with ocamlc i get a segmentation fault. 
> 
> Is it a bug in the ocaml system ? I did not succeed to isolate it.
>                                  ----------------------
> module LL (R : sig
>  type t
>  val add : t -> t -> t
> end) =
>  struct
>    type t = R.t list
>    let add = List.map2 (R.add)
>  end
> 
> module rec M : sig
>    type t = P of int | L of LS.t
>    val add : t -> t -> t
>    val to_string : t -> string
>  end = struct
>    type param = ()
>    type t = P of int
>                | L of LS.t
>              let add a b = match a, b with
>      P a', P b' -> P (a'+b')
>    | L a', L b' -> L (LS.add a' b')
>    | _ -> failwith "incompatible"
> 
>    let rec to_string = function
>       P i -> string_of_int i
>     | L l -> List.fold_left (fun r x -> r^" "^(to_string x)) "" l
>  end
> and LS : sig type t = M.t list val add : t -> t -> t end = LL(M)
> 
> open M
> let p = L [P 1; P 2]
> let q = add p p
> let () =
>  print_endline (to_string p);
>  print_endline (to_string q)


Strangely, OCaml version 3.08.0 can handle this code.
So, the developer team must know the reason.
Did you write a bug report ?

Keiko NAKATA



  parent reply	other threads:[~2006-04-19  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-18 23:16 Marc Lasson
2006-04-18 22:29 ` [Caml-list] " Jonathan Roewen
2006-04-19  8:45 ` Keiko Nakata [this message]
2006-04-19 19:38   ` Marc Lasson
2006-04-19 18:57     ` Remi Vanicat
2006-04-19  9:33 ` Sebastian Egner
2006-04-19  9:44   ` Jonathan Roewen
2006-04-19 10:55     ` Sebastian Egner
2006-04-19 20:24       ` Alain Frisch

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=20060419.174523.68533574.keiko@kurims.kyoto-u.ac.jp \
    --to=keiko@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=titmarc@free.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).