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 83AD77EE25 for ; Sun, 27 Oct 2013 19:27:07 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.184.40; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.184.40; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@bluechip4.ukhost4u.com) identity=helo; client-ip=188.64.184.40; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluechip4.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUDABNabVK8QLgoemdsb2JhbABZgz+/M4EcFg4BAQsHDQk8giUBAQUnEUABEAsHBwoJEwMPCQMCAQIBRQYOiBABuAuPVQeELAOeRY5y X-IPAS-Result: AnUDABNabVK8QLgoemdsb2JhbABZgz+/M4EcFg4BAQsHDQk8giUBAQUnEUABEAsHBwoJEwMPCQMCAQIBRQYOiBABuAuPVQeELAOeRY5y X-IronPort-AV: E=Sophos;i="4.93,581,1378850400"; d="scan'208";a="32098814" Received: from bluechip4.ukhost4u.com ([188.64.184.40]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Oct 2013 19:27:06 +0100 Received: from [78.105.203.81] (port=50611 helo=feast.local) by bluechip4.ukhost4u.com with esmtpa (Exim 4.80.1) (envelope-from ) id 1VaV3K-001tBX-NQ; Sun, 27 Oct 2013 18:27:06 +0000 Message-ID: <526D5AF9.9030303@coherentgraphics.co.uk> Date: Sun, 27 Oct 2013 18:27:05 +0000 From: John Whitington User-Agent: Postbox 3.0.8 (Macintosh/20130427) MIME-Version: 1.0 To: Yaron Minsky CC: "caml-list@inria.fr" 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 - bluechip4.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: bluechip4.ukhost4u.com: authenticated_id: john@coherentgraphics.co.uk Subject: Re: [Caml-list] Should -strict-sequence become the default? Hi, Yaron Minsky wrote: > Back in 3.12.1, a flag, -strict-sequence, was added that require that > the left-hand side of a sequence returns unit. I suspect there's > broad agreement that -strict-sequence is the better default, but that > the old behavior has been left in place by default for compatibility > reasons. I wonder if in the next major release, it would make sense > to make -strict-sequence the default, and have a flag for enabling the > old behavior. > > To say the obvious, such a change would be of no value to experienced > people and organizations that know how to set up the compiler to their > liking, but can be of real value to newcomers to the language. Isn't this covered (as a warning not an error) by warnings 5 & 10, both of which are default? Although the manual does say, rather ominously... "Note that warnings 5 and 10 are not always triggered, depending on the internals of the type checker." Does that caveat also apply to -strict-sequence? If not, why not, and could its implementation be back-ported to fix up warnings 5 and/or 10? feast:~ john$ ocaml -strict-sequence OCaml version 4.01.0 # let f x = x + 1;; val f : int -> int = # f 1; 0;; Error: This expression has type int but an expression was expected of type unit feast:~ john$ ocaml OCaml version 4.01.0 # let f x = x + 1;; val f : int -> int = # f 1; 0;; Warning 10: this expression should have type unit. - : int = 0 The warning text for warning 10 could be changed to: "Warning 10: this expression should have type unit. If this is intended, consider using the 'ignore' function." Cheers, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/