From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA04582; Sun, 24 Feb 2002 19:33:32 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA04592 for ; Sun, 24 Feb 2002 19:33:31 +0100 (MET) Received: from mailrelay2.inwind.it (mailrelay2.inwind.it [212.141.54.102]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g1OIXU118724 for ; Sun, 24 Feb 2002 19:33:30 +0100 (MET) Received: from dalamar.takhisis.org (62.98.122.205) by mailrelay2.inwind.it (5.5.053) id 3C727F58002F9A46 for caml-list@inria.fr; Sun, 24 Feb 2002 19:33:30 +0100 Received: from lordsoth.takhisis.org (lordsoth.takhisis.org [192.168.1.119]) by dalamar.takhisis.org (8.12.0/8.12.0/Debian -3) with ESMTP id g1OIXOs4002352 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Sun, 24 Feb 2002 19:33:28 +0100 Received: from lordsoth.takhisis.org (localhost [127.0.0.1]) by lordsoth.takhisis.org (8.12.0/8.12.0/Debian -3) with ESMTP id g1OIXNUR004787 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Sun, 24 Feb 2002 19:33:23 +0100 Received: (from zack@localhost) by lordsoth.takhisis.org (8.12.0/8.12.0/Debian -3) id g1OIXNi4004785 for caml-list@inria.fr; Sun, 24 Feb 2002 19:33:23 +0100 Date: Sun, 24 Feb 2002 19:33:23 +0100 From: Stefano Zacchiroli To: CAML list Subject: Re: [Caml-list] Narrowing coercions for functions with optional parameters Message-ID: <20020224183323.GB4757@cs.unibo.it> Mail-Followup-To: CAML list References: <20020224140125.GA26745@cs.net.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020224140125.GA26745@cs.net.pl> User-Agent: Mutt/1.3.27i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, Feb 24, 2002 at 03:01:25PM +0100, Tomasz Zielonka wrote: > # let coerce f x = f x > val coerce : ('a -> 'b) -> 'a -> 'b = > > # coerce g ;; > - : int -> int = With such a call you haven't change the original "g" function so the coersion of "g" to "int -> int" doesn't work because it was applied to the old "g" function. Try this (after executing your examples of course): # let g = coerce g;; val g : int -> int = # (g : int -> int) ;; - : int -> int = Hope this helps. Cheers. -- Stefano Zacchiroli - undergraduate student of CS @ Univ. Bologna, Italy zack@cs.unibo.it | ICQ# 33538863 | http://www.cs.unibo.it/~zacchiro "I know you believe you understood what you think I said, but I am not sure you realize that what you heard is not what I meant!" -- G.Romney ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners