From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C4891BBCA for ; Mon, 25 Feb 2008 17:02:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJN0wkfBL1AZkmdsb2JhbACQXgEBAQEHBAYHIpoB X-IronPort-AV: E=Sophos;i="4.25,401,1199660400"; d="scan'208";a="23007009" Received: from gw.exalead.com (HELO exalead.com) ([193.47.80.25]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Feb 2008 17:02:44 +0100 Received: from [192.168.204.148] (madpc064.exalead.com [192.168.204.148]) (authenticated bits=0) by exalead.com (8.14.0/8.14.0) with ESMTP id m1PG2Mbj011097; Mon, 25 Feb 2008 17:02:25 +0100 Message-ID: <47C2E68E.2020401@exalead.com> Date: Mon, 25 Feb 2008 17:02:22 +0100 From: Berke Durak User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Edgar Friendly Cc: "Tiphaine.Turpin" , caml-list@yquem.inria.fr Subject: Re: [Caml-list] OO programming References: <47BD44FE.3050001@irisa.fr> <20080224163308.GA3459@feanor> <47C288FD.8070602@free.fr> <47C2E369.9080206@gmail.com> In-Reply-To: <47C2E369.9080206@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 ocaml:01 mli:01 val:01 mli:01 val:01 ocaml:01 sig:01 edgar:98 char:01 char:01 imho:01 Edgar Friendly a écrit : > Tiphaine.Turpin wrote: >>> or they are required by the GUI >>> layer), and that OCaml has now way to seperate method/function >>> declaration and type declaration (unless one uses a mli file, which is >>> again inconvenient because it splits information that belongs together >>> into two complete different places). I'd really appreciate it if one >>> could just mix "val" type declcarations with "let" or "method" code >>> declarations. >>> >> I don't understand what you want here. > > I read him as asking for .ml files to contain what .mli files now > contain - i.e. method/function declarations > > Example - string_annex.ml: > > val init: int -> (int -> char) -> string > > let init n f = > let s = make n (f 0) in > for i=1 to n-1 do > set s i (f i); > done; > s > > > OCaml doesn't permit this at the moment because val statements go in > .mli files (or in sig blocks) only. > Yes that could be nice but it's no biggie IMHO. let init n f = let s = make n (f 0) in for i=1 to n-1 do set s i (f i); done; s let init : int -> (int -> char) -> string = init -- Berke DURAK