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 2227B7F2AA for ; Mon, 17 Dec 2012 13:11:54 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of philippe.veber@gmail.com) identity=pra; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of philippe.veber@gmail.com designates 209.85.210.182 as permitted sender) identity=mailfrom; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ia0-f182.google.com) identity=helo; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="postmaster@mail-ia0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcBACQLz1DRVdK2m2dsb2JhbABFvioIFg4BAQEBAQgJCwkUJ4JMGQEbHgMSCQEGXQERAQUBFgwbh3gBAw+ZAoJtjDOCe4QtChknDVmIdgEFDJEUA5YKjmgWKYQV X-IronPort-AV: E=Sophos;i="4.84,300,1355094000"; d="scan'208";a="166062135" Received: from mail-ia0-f182.google.com ([209.85.210.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Dec 2012 13:11:53 +0100 Received: by mail-ia0-f182.google.com with SMTP id x2so5446658iad.27 for ; Mon, 17 Dec 2012 04:11:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=dlUfgbDG0exlIoYP51uJOAkPXwTk0ItejW9+OR6Q1p4=; b=nPtKv/xtSjbgmPaQT4KlHmJIWY6L8JyzrjljMd0NBV5YATgq6AljNlefEdnESkvWEG toW3LouYq5esBYeg2ghCLgUhiiumvkSUPcTmUk3wlxsZa+gXXbyfH7t2dqwELOW743ga 77WNEVp0vRZgXZfjKVZBLTcYXf6OyV/DfAXWmKAbHcQsCVai7BsSiJVSJ/SL2qo9LbpA 8G+W3uLnev4/q2zuds5M2BgEBfpnLSytSojJDG/F605DsFtZ65tf4y1UzBsiXIYDTrZx TqegNFdRKqqbZZzLx0vPzXGQgEfgJqVqOmWlvpYCv7zaJcqLlnkKPu1s9K+4q/Drjx5f 9SGg== Received: by 10.50.77.166 with SMTP id t6mr8792472igw.72.1355746311815; Mon, 17 Dec 2012 04:11:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.49.195 with HTTP; Mon, 17 Dec 2012 04:11:31 -0800 (PST) From: Philippe Veber Date: Mon, 17 Dec 2012 13:11:31 +0100 Message-ID: To: caml users Content-Type: multipart/alternative; boundary=e89a8f3baff752416004d10b49c8 X-Validation-by: philippe.veber@gmail.com Subject: [Caml-list] ignore semantics --e89a8f3baff752416004d10b49c8 Content-Type: text/plain; charset=ISO-8859-1 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 = () 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. --e89a8f3baff752416004d10b49c8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Dear all,

This is a rather minor issue, but I was surprised by the f= ollowing answers of the interpreter:

=A0=A0=A0=A0=A0=A0=A0 OCaml version 4.00.1

# ignore succ;;
Warning= 5: this function application is partial,
maybe some arguments are = missing.
- : unit =3D ()
# (fun _ -> ()) succ;;=
- : unit =3D ()

I naively used to think the two expressions were equivalent. Reading pe= rvasives.mli, I found that ignore is a primitive:

external ignore : = 'a -> unit =3D "%ignore"

which means it is treated = as a special case. Just for curiosity, what is the rationale for the warnin= g in the first case?

Cheers,
=A0 Philippe.


--e89a8f3baff752416004d10b49c8--