[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,

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

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 is actually

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:(title : string; .. as 'a) - unit - bool; step2 : string - bool; step3 : 'a. story:(title : string; count : int; .. as 'a) - bool } let rec steps = { [...] IMHO, recursive modules

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 stefan.ratsc...@cs.cas.cz 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,

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

[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