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=1.3 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id EFEC5BC69 for ; Tue, 24 Apr 2007 20:14:36 +0200 (CEST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l3OIEabp015747 for ; Tue, 24 Apr 2007 20:14:36 +0200 Received: (qmail invoked by alias); 24 Apr 2007 18:14:36 -0000 Received: from krlh-d9be136d.pool.mediaWays.net (EHLO hmmm.de) [217.190.19.109] by mail.gmx.net (mp058) with SMTP; 24 Apr 2007 20:14:36 +0200 X-Authenticated: #20477425 X-Provags-ID: V01U2FsdGVkX18+hulzW50+7r2yPbgGZY6K8+FLsJIRT1fdtlBNWV 9hohTCIPL7NsKZ Date: Tue, 24 Apr 2007 20:14:35 +0200 From: micha To: caml-list@inria.fr Subject: typing question Message-ID: <20070424201435.38f2f5f9@hmmm.de> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 462E490C.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; cheers:01 typing:01 int:01 int:01 callback:02 callback:02 string:02 string:02 let:03 let:03 incr:06 incr:06 michael:07 fun:08 question:12 Hi, why is the type of register1 'a -> string but the type of register2 _'a -> string? cheers Michael let symbol_id = ref 0;; let register1 fkt = let name = "symbol-" ^ (string_of_int !symbol_id) in incr symbol_id; Callback.register name fkt; name ;; let register2 = let symbol_id = ref 1 in fun fkt -> let name = "symbol-" ^ (string_of_int !symbol_id) in incr symbol_id; Callback.register name fkt; name ;;