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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 0C35E7F2AA for ; Tue, 18 Dec 2012 02:28:53 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of berenger@riken.jp) identity=pra; client-ip=134.160.33.175; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of berenger@riken.jp designates 134.160.33.175 as permitted sender) identity=mailfrom; client-ip=134.160.33.175; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of postmaster@postman.riken.jp designates 134.160.33.175 as permitted sender) identity=helo; client-ip=134.160.33.175; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="postmaster@postman.riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMAAI7Gz1CGoCGvmWdsb2JhbABFulqDZw4BAQEBAQgLCwcUJ4IeAQEEAScRRgsLGAklDwJGEwgBAYgJBqodkDCMUYEagykDiF+NK4VrjV8 X-IronPort-AV: E=Sophos;i="4.84,305,1355094000"; d="scan'208";a="186577198" Received: from postman3.riken.jp (HELO postman.riken.jp) ([134.160.33.175]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Dec 2012 02:28:51 +0100 Received: from postman.riken.jp (postman3.riken.jp [127.0.0.1]) by postman.riken.jp (Postfix) with SMTP id 5EA3838380DB for ; Tue, 18 Dec 2012 10:28:47 +0900 (JST) Received: from [172.27.98.103] (rikad98.riken.jp [134.160.214.98]) by postman.riken.jp (Postfix) with ESMTPA id 13BC738201B5 for ; Tue, 18 Dec 2012 10:28:47 +0900 (JST) Message-ID: <50CFC6CF.20906@riken.jp> Date: Tue, 18 Dec 2012 10:28:47 +0900 From: Francois Berenger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.12.18.11521 Subject: Re: [Caml-list] ignore semantics On 12/17/2012 09:11 PM, Philippe Veber wrote: > Dear all, > > 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 = () Didn't you intended to write ignore (succ 0);; (or with any other integer instead of 0) ? In that case it compiles but I don't get what the code is intended to do. Regards, F. > 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? > > Cheers, > Philippe. > >