[Caml-list] User-defined printers and external C code

2010-03-28 Thread Stefan Ratschan
> The printing of Big_int is possible and AFAIK Big_int is an abstract > data type. > let print_big_int (value_big_int:Big_int.big_int) = >Format.printf "%s" (Big_int.string_of_big_int value_big_int);; I see, thanks. If I interpret this correctly, then the same code is loaded twice. Once in

[Caml-list] Structural subtyping problem

2010-03-28 Thread Dario Teixeira
Hi, I'm using the structural subtyping aspects of Ocaml's object system to emulate width subtyping. I've come across a problem which does not type-check, though intuitively it seems correct. I reckon that the compiler may need some help in the form of type annotations and/or coercions, though

Re: [Caml-list] Structural subtyping problem

2010-03-28 Thread Vincent Aravantinos
Hi, the following seems to do the trick (?) : Le 28 mars 10 à 18:38, Dario Teixeira a écrit : let rec step1 ?story () = match story with | Some s -> step2 s#title | None -> step2 "title1" and step2 title = let story = object m

Re: [Caml-list] Structural subtyping problem

2010-03-28 Thread Andreas Rossberg
On Mar 28, 2010, at 18.38 h, Dario Teixeira wrote: Hi, I'm using the structural subtyping aspects of Ocaml's object system to emulate width subtyping. I've come across a problem which does not type-check, though intuitively it seems correct. I reckon that the compiler may need some help

Re: [Caml-list] Structural subtyping problem

2010-03-28 Thread Stéphane Glondu
Dario Teixeira a écrit : > A simple nonsensical example that illustrates the problem is listed below; the > type-checking error occurs in function "step1", where the optional parameter > "story" > is used as an object of type "< title:string; .. >". In function "step3", > this > parameter "story

Re: [Caml-list] Structural subtyping problem

2010-03-28 Thread Christophe TROESTLER
Hi, On Sun, 28 Mar 2010 19:32:37 +0200, Stéphane Glondu wrote: > > type steps = { > step1 : 'a. ?story:( as 'a) -> unit -> bool; > step2 : string -> bool; > step3 : 'a. story:( as 'a) -> bool > } > > let rec steps = { [...] IMHO, recursive modules are also a nice way to achieve the same

Re: [Caml-list] User-defined printers and external C code

2010-03-28 Thread Dmitry Bely
On Sun, Mar 28, 2010 at 2:24 PM, Stefan Ratschan wrote: >> The printing of Big_int is possible and AFAIK Big_int is an abstract >> data type. > >> let print_big_int (value_big_int:Big_int.big_int) = >>    Format.printf "%s" (Big_int.string_of_big_int value_big_int);; > > I see, thanks. If I interp

Re: [Caml-list] Structural subtyping problem

2010-03-28 Thread Dario Teixeira
Hi, > I'm using the structural subtyping aspects of Ocaml's object system to > emulate width > subtyping.  I've come across a problem which does not type-check, though > intuitively > it seems correct.  I reckon that the compiler may need some help in the form > of type > annotations and/or coe

[Caml-list] APLAS 2010 CFP

2010-03-28 Thread Eijiro Sumii
CALL FOR PAPERS APLAS 2010 Eighth Asian Symposium on Programming Languages and Systems Shanghai, China November 28-December 1, 2010 http://basics.sjtu.edu.cn/conference/aplas2010/