From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id B0B687F2AA for ; Mon, 17 Dec 2012 14:32:43 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.186.31; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.186.31; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@bluemoon3.ukhost4u.com) identity=helo; client-ip=188.64.186.31; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluemoon3.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8CAPwdz1C8QLofgWdsb2JhbABFvjMWDgEBFiYngh4BAQUnEUABEAsHEQkTAw8JAwIBAgFFBg6IHLohkSADqUU X-IronPort-AV: E=Sophos;i="4.84,300,1355094000"; d="scan'208";a="166072568" Received: from bluemoon3.ukhost4u.com ([188.64.186.31]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Dec 2012 14:32:43 +0100 Received: from 78-105-203-81.zone3.bethere.co.uk ([78.105.203.81]:51588 helo=feast.lan) by bluemoon3.ukhost4u.com with esmtpa (Exim 4.80) (envelope-from ) id 1Tkabs-0008RG-1k; Mon, 17 Dec 2012 13:19:56 +0000 Message-ID: <50CF1EF8.6010503@coherentgraphics.co.uk> Date: Mon, 17 Dec 2012 13:32:40 +0000 From: John Whitington User-Agent: Postbox 3.0.6 (Macintosh/20121022) MIME-Version: 1.0 To: Philippe Veber CC: caml users References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluemoon3.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Get-Message-Sender-Via: bluemoon3.ukhost4u.com: authenticated_id: john@coherentgraphics.co.uk X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [Caml-list] ignore semantics Hi, Philippe Veber wrote: > This is a rather minor issue, but I was surprised by the following > answers of the interpreter: > > OCaml version 4.00.1 > > # ignore succ;; > Warning 5: this function application is partial, > maybe some arguments are missing. > - : unit = () > # (fun _ -> ()) succ;; > - : unit = () > > I naively used to think the two expressions were equivalent. Reading > pervasives.mli, I found that ignore is a primitive: > > external ignore : 'a -> unit = "%ignore" > > which means it is treated as a special case. Just for curiosity, what is > the rationale for the warning in the first case? Imagine you wrote: ignore (output_something_and_return_something) When what you wanted was ignore (ouput_something_and_return_something ()) You'd want the partial application error there, even though you are (intentionally) ignoring the return value of the function. Cheers, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/