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 98910BBAF for ; Fri, 11 Sep 2009 10:24:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhUCAEulqUpV2gB5mWdsb2JhbACbRAEBAQEBCAsKBxPBDoQYBYFU X-IronPort-AV: E=Sophos;i="4.44,369,1249250400"; d="scan'208";a="46364731" Received: from emailfrontal2.citycable.ch ([85.218.0.121]) by mail4-smtp-sop.national.inria.fr with SMTP; 11 Sep 2009 10:24:44 +0200 Received: from [192.168.0.10] (unknown [85.218.92.99]) (Authenticated sender: guillaume.yziquel@citycable.ch) by emailfrontal2.citycable.ch (Postfix) with ESMTPA id C9C56B103FF; Fri, 11 Sep 2009 10:24:40 +0200 (CEST) Message-ID: <4AAA083E.7070902@citycable.ch> Date: Fri, 11 Sep 2009 10:20:14 +0200 From: Guillaume Yziquel Reply-To: guillaume.yziquel@citycable.ch User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: blue storm Cc: Jacques Garrigue , caml-list@inria.fr Subject: Re: [Caml-list] polymorphic method. References: <4AA8F16F.1040009@citycable.ch> <20090910.214827.104047449.garrigue@math.nagoya-u.ac.jp> <4AA8F986.1060206@citycable.ch> <20090910.232102.112610940.garrigue@math.nagoya-u.ac.jp> <4AA95027.5050308@citycable.ch> <527cf6bc0909110014s7da89384hdd86fb87f0e1969d@mail.gmail.com> In-Reply-To: <527cf6bc0909110014s7da89384hdd86fb87f0e1969d@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; guillaume:01 guillaume:01 camlp:01 foo:01 baz:01 translated:01 foo:01 baz:01 storm:98 polymorphic:01 polymorphic:01 caml-list:01 caml:02 objective:02 checking:02 blue storm a =C3=A9crit : > > With a camlp4 extension, you could inspect the (syntaxically explicit) > parameters of you method, and (syntaxically) generate a polymorphic > type for each one : "polymorphic method foo bar baz =3D ..." would be > translated into "method foo : 'a 'b . 'a -> 'b -> 'c =3D fun (bar : 'a) > (baz : 'b) -> ...". > This is probably not what you want. Indeed, it's not what I want. > but my general advice is not to try to much to do > type-level transformation by syntaxic transformations : they tend to > get flawed in ways you don't expect, and this is just not the right > tool for the job. Too bad there's no "type checking extension" in Objective Caml. That=20 would be huge fun. Thanks. --=20 Guillaume Yziquel http://yziquel.homelinux.org/