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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id CD4E67EE25 for ; Wed, 5 Jun 2013 08:54:50 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of virgile.prevosto@gmail.com) identity=pra; client-ip=209.85.223.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="virgile.prevosto@gmail.com"; x-sender="virgile.prevosto@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of virgile.prevosto@gmail.com designates 209.85.223.177 as permitted sender) identity=mailfrom; client-ip=209.85.223.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="virgile.prevosto@gmail.com"; x-sender="virgile.prevosto@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f177.google.com) identity=helo; client-ip=209.85.223.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="virgile.prevosto@gmail.com"; x-sender="postmaster@mail-ie0-f177.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUBAIDfrlHRVd+xlGdsb2JhbABawmMZXwgWDgEBAQEHCwsJEiqCJAEFJxkBOAEDDAEFBQs7IhIBBQEcGYd7Aw+eb49JhQ4nDYhvAQUMjW53gw+BBgOXP49bFimBXYJaOg X-IPAS-Result: AoUBAIDfrlHRVd+xlGdsb2JhbABawmMZXwgWDgEBAQEHCwsJEiqCJAEFJxkBOAEDDAEFBQs7IhIBBQEcGYd7Aw+eb49JhQ4nDYhvAQUMjW53gw+BBgOXP49bFimBXYJaOg X-IronPort-AV: E=Sophos;i="4.87,804,1363129200"; d="scan'208";a="16797984" Received: from mail-ie0-f177.google.com ([209.85.223.177]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Jun 2013 08:54:49 +0200 Received: by mail-ie0-f177.google.com with SMTP id u16so2582999iet.8 for ; Tue, 04 Jun 2013 23:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:cc:content-type :content-transfer-encoding; bh=0aUYeZJT/wlR6doe25LaBg52Y63/Yu1vzIC/fCMYKxg=; b=W40FyBUo/sVwG/jArV65ODfcl0SF7jf5qx1gCnNFApn4uSmsG202KC4knGHV7tvpf/ HFamMiEFWhix/ZkHOoGyAm6elWZmdFC4acDnBE6Gn80BFyB/eULM71b17a1TavL1ZEPN ZMIKoK6mKBZyG7viGpJhgrJbApSorVjE49WnkNq5H7+kQOjuNwHSvVP9hKC2feglFjL+ Q0NPJsPspu3JFfYXCVUQO12qsTQ25c6H+oxY22VwFUHCQ5RiWaJP4hPdoKKIRp68UJls +GVLPNfoMsOI/bVYcl1a7YrNBRUbyXbw4lFb/GEAuwHron/rDR6zGS1kf4cP6vvKU1mM dEBQ== MIME-Version: 1.0 X-Received: by 10.50.176.202 with SMTP id ck10mr2637110igc.9.1370415288551; Tue, 04 Jun 2013 23:54:48 -0700 (PDT) Sender: virgile.prevosto@gmail.com Received: by 10.64.29.38 with HTTP; Tue, 4 Jun 2013 23:54:48 -0700 (PDT) In-Reply-To: <87sj0xqgb8.fsf@golf.niidar.ru> References: <87sj0xqgb8.fsf@golf.niidar.ru> Date: Wed, 5 Jun 2013 08:54:48 +0200 X-Google-Sender-Auth: oASVNAi1l9zzUGZjDfJbyVr17Ro Message-ID: From: Virgile Prevosto Cc: OCAML Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Warning 28. Hello Ivan, 2013/6/5 Ivan Gotovchits : > | Ref n -> ... > ... > > where Ref is: > > type t =3D > ... > | Ref of int > > Compiler issues me a warning: > > =ABWarning 28: wildcard pattern given as argument to a constant construct= or=BB > > Sorry, but if I understand this wording correctly, then I do not see > anything criminal in issuing a wildcard pattern to a constant > constructor. What is wrong? OCaml is not complaining about your Ref constructor, but another one that does not have any argument, but is nevertheless given a wildcard pattern in the matching, as e.g. None in the following code: # let f default =3D function | Some n -> n | None _ -> default;; Warning 28: wildcard pattern given as argument to a constant constructor The 'None _' is suspicious at best. Tolerating such kind of pattern reportedly eases generation of OCaml code, and that's why it is a warning and not a plain error. Best regards, -- E tutto per oggi, a la prossima volta Virgile