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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id ACD9CBC69 for ; Mon, 30 Oct 2006 14:22:25 +0100 (CET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9UDMNki031205 for ; Mon, 30 Oct 2006 14:22:24 +0100 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id k9UDM8E6005517; Mon, 30 Oct 2006 22:22:09 +0900 (JST) Date: Mon, 30 Oct 2006 22:21:36 +0900 (JST) Message-Id: <20061030.222136.93016075.garrigue@math.nagoya-u.ac.jp> To: ermine@ermine.pp.ru Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] class and printf From: Jacques Garrigue In-Reply-To: <20061030124223.GA46814@ermine.home> References: <20061030124223.GA46814@ermine.home> X-Mailer: Mew version 5.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4545FC8F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; printf:01 foo:01 myprintf:01 printf:01 fprintf:01 compiler:01 myprintf:01 foo:01 fprintf:01 drink:98 unbound:01 compile:01 caml-list:01 garrigue:03 garrigue:03 From: Anastasia Gornostaeva > What I need to drink to compile it? > > class foo ch = > object > method myprintf = Printf.fprintf ch > end > > The compiler says > The method myprintf has type ('a, out_channel, unit) format -> 'a where 'a > is unbound Since I assume that you want to be able to use differently typed formats with the same object, class foo ch = object method myprintf : 'a. ('a, out_channel, unit) format -> 'a = Printf.fprintf ch end Jacques Garrigue