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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id BB79CBBAF for ; Mon, 26 May 2008 21:43:56 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgBAGivOkjAXQImiGdsb2JhbACBVZBlAQEBDyCZew X-IronPort-AV: E=Sophos;i="4.27,543,1204498800"; d="scan'208";a="12739323" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 May 2008 21:43:56 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4QJhuj7015494 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 26 May 2008 21:43:56 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8BAN6vOkjQccgFf2dsb2JhbACBVZBlAQELBQIGBxGZfg X-IronPort-AV: E=Sophos;i="4.27,543,1204498800"; d="scan'208";a="26627255" Received: from lax-green-bigip-5.dreamhost.com (HELO looneymail-a1.g.dreamhost.com) ([208.113.200.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 26 May 2008 21:43:55 +0200 Received: from Smokejumper-MBP.local (c-76-113-178-230.hsd1.mn.comcast.net [76.113.178.230]) by looneymail-a1.g.dreamhost.com (Postfix) with ESMTP id B9D2115F3B1 for ; Mon, 26 May 2008 12:43:51 -0700 (PDT) Message-ID: <483B12F7.3080301@fischerventure.com> Date: Mon, 26 May 2008 14:43:51 -0500 From: Robert Fischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Question about type unification References: <20080526122204.GA6727@annexia.org> <20080526192157.3e75c121@orange.fr> <483B0F81.1020907@fischerventure.com> <483B11A5.5030209@doomeer.com> In-Reply-To: <483B11A5.5030209@doomeer.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at discorde with ID 483B12FC.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; unification:01 compiler:01 abbreviation:01 compiler:01 wrote:01 caml-list:01 output:02 string:02 string:02 float:03 float:03 ecrit:06 break:08 actually:10 actually:10 Ahh. Yeah, I see it now -- the output wasn't a string, but a float. It just has the word "string" in the type name to confuse me. ~~ Robert. DooMeeR wrote: > Robert Fischer a écrit : >> How is the compiler magically getting from the float to a string >> value? Can someone break down >> what's actually happening here for me? > > It's not "getting to" a "string" value but to a "string t" value, which > is an abbreviation for "float". The value has type "float", but the user > requires type "string t", so the compiler unifies "float" and "string t" > which is actually "float" so it's ok, and then the compiler gives the > type requested by the user to the value, i.e., "string t". > > Well, at least, this is how I understand this :) >