From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id C83145D4 for ; Fri, 7 Sep 2018 10:14:00 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.53,342,1531778400"; d="scan'208";a="345379332" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 07 Sep 2018 12:13:59 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id C3F10824CF; Fri, 7 Sep 2018 12:13:59 +0200 (CEST) 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 12F07824B2 for ; Fri, 7 Sep 2018 12:13:57 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=garrigue@math.nagoya-u.ac.jp; spf=None smtp.mailfrom=garrigue@math.nagoya-u.ac.jp; spf=None smtp.helo=postmaster@ms.math.nagoya-u.ac.jp IronPort-PHdr: =?us-ascii?q?9a23=3ABfNQuBZ/JTL9J/g2hnraUzn/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZr8+9bnLW6fgltlLVR4KTs6sC17KJ9fi4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQpFiCa/bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+?= =?us-ascii?q?RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPC?= =?us-ascii?q?TQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhz?= =?us-ascii?q?sGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJSyNODZ6y?= =?us-ascii?q?YYsNAOQPMuhWrIf9qUUJoxalGQmsHebvxiNIhnPq36A31fkqHwHc3AwnGtIDqH?= =?us-ascii?q?Dao8/pO6cLTOC60rLIxijCYfxMwzf98onIch88of6SQLl9dsXRxlM1FwPfj1WQ?= =?us-ascii?q?ppHlMC2O2+QIqWeb8+pgWfipi2E9pAFxpTiuyd01honUnI4a0EzL+T97wIYtPN?= =?us-ascii?q?C1TlNwb928EJZIqi2XOYV7TtkjTm1ypSo3xKEKtYSmcCQX0Jgqxx3SZ+aaf4WI?= =?us-ascii?q?4R/vTvudLSl7iX5/Zb6yhxS//E69wePmTMa0ykxFri9dn9nMqH8N0xvT59CCSv?= =?us-ascii?q?tm5Euh3CyA1xzT6u1eJ0A7j6XbK5khw7Eqj5YTrF7PETXql0nsjq+Wbl0o+umu?= =?us-ascii?q?6+v5frXrvoKQOoF6hw3kM6kigNGzDOokPgQUQmSX5Pyw1Lj58k34RLVKgOc2kq?= =?us-ascii?q?7csJ3CKsQUvLS5AxVU0oYs9hawESyr0NECknkbLFJJYhSHgJLmO1HJIPH3F+6z?= =?us-ascii?q?g0m2nDhx2//KJL/hAo3VInjZjLjhZap961JbyAcr0d9Q/ZdUCrUYLPL3W0/xr8?= =?us-ascii?q?DYAwQiMw20xubnEM9y2pkfWWKJGK+ZMbndvUWG5uI1cKGwY9o8vD/8LbAL/f/1?= =?us-ascii?q?hn9xzVYZdKivm5UNaWuzHtxiLlWYb3uqidAERzQkpA07Gc7jg0SfXCUbSH+oRa?= =?us-ascii?q?Mz+zxzXI2vF53CSZ2gqLmIwCf9GJRZYXFPT03KGHyudZ3SCKREUz6bPsI0ym9M?= =?us-ascii?q?brOmUYJ0kEj27FarmYoiFfLd/2gjjbym0dF04+PJkhRorG5xBtidlWeEQGZlly?= =?us-ascii?q?YVATY9mqJn8xQklgWzlJNgivkdLuR9outTW11jZ5vV0+w8Ddn9XRPIO8rPQV3g?= =?us-ascii?q?QM30WWhsHOJ0+McHZgNGI/vnjh3H2HD2UboO0bmCGJxy9KvT2Gn4Yts7wn2A1r?= =?us-ascii?q?Fz11Q=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CsAABATpJblwuCBoVbHAEBAQQBAQoBA?= =?us-ascii?q?YQ2ahIog3KIco1QmCwBCoRsAoN4BgY0FAECAQECAQEBAQETAQEBAQEIFgZMDII?= =?us-ascii?q?1JAGCXgEBAQMBIwQZAQE3AQ8LGAICJgICVwaDNIF6B6QPb3szgnUBAQWBcIMBG?= =?us-ascii?q?YICCIELiXGCAIE5H4IeLoR+LIJVMYImhjIHhwxujUwJkAEXgUCEP4JZhhWRJIJ?= =?us-ascii?q?kgVmBdk04OyoBgkE+gVsahlSHW2CNMwEB?= X-IPAS-Result: =?us-ascii?q?A0CsAABATpJblwuCBoVbHAEBAQQBAQoBAYQ2ahIog3KIco1?= =?us-ascii?q?QmCwBCoRsAoN4BgY0FAECAQECAQEBAQETAQEBAQEIFgZMDII1JAGCXgEBAQMBI?= =?us-ascii?q?wQZAQE3AQ8LGAICJgICVwaDNIF6B6QPb3szgnUBAQWBcIMBGYICCIELiXGCAIE?= =?us-ascii?q?5H4IeLoR+LIJVMYImhjIHhwxujUwJkAEXgUCEP4JZhhWRJIJkgVmBdk04OyoBg?= =?us-ascii?q?kE+gVsahlSHW2CNMwEB?= X-IronPort-AV: E=Sophos;i="5.53,342,1531778400"; d="scan'208";a="278093467" Received: from bsd20.math.nagoya-u.ac.jp (HELO ms.math.nagoya-u.ac.jp) ([133.6.130.11]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2018 12:13:55 +0200 Received: from [192.168.0.12] (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.math.nagoya-u.ac.jp (Postfix) with ESMTPSA id 8692F73EBBD; Fri, 7 Sep 2018 19:13:51 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.nagoya-u.ac.jp; s=20160220; t=1536315231; bh=jN9HKKdZzHfe8x03kU6U72Qpe+VaIdA68iSW7nqvPWU=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=QrTVChM5EWHe7PS2iRP7yOsxMGJsHiQWEHkywYtt+1ecua01yJFjt4mTAIQdbDP3N 4TYGHZydTNo2IILQK7eND8qvALLHirYDOWXCaXjKwBsv/E1Wfi0ROW7ACohSx6HwH8 wmgcDXtVv+a4uZ6w4Qcp904qSyiHTzOAEQySGK5s= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) From: Jacques Garrigue In-Reply-To: <990e9e46-1e1b-7d5d-b776-f8c23739f91a@lexifi.com> Date: Fri, 7 Sep 2018 19:13:49 +0900 Cc: Mailing List OCaml Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180906113622.lcuamhs6g6juv2r5@gargamel> <3bd16eb6-392e-51ea-03e0-1180ee47d2e5@lexifi.com> <19F1F466-19C4-482E-BB2E-553047888A2E@math.nagoya-u.ac.jp> <990e9e46-1e1b-7d5d-b776-f8c23739f91a@lexifi.com> To: Alain Frisch X-Mailer: Apple Mail (2.3445.9.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (ms.math.nagoya-u.ac.jp [0.0.0.0]); Fri, 07 Sep 2018 19:13:51 +0900 (JST) X-Virus-Scanned: clamav-milter 0.99.2 at bsdserver20 X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on bsdserver20.math.nagoya-u.ac.jp Subject: Re: [Caml-list] How to rename a record field Reply-To: Jacques Garrigue X-Loop: caml-list@inria.fr X-Sequence: 17062 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2018/09/07 17:36, Alain Frisch wrote: >=20 > On 07/09/2018 01:45, Jacques Garrigue wrote: >> Interesting idea. >> This should be easily doable, for instance by extending the Asttypes.arg= _label type. >=20 > One could also just keep the information on the value binding itself: >=20 > val foo: ?x:int -> ?y:float-> int -> int > [@@ocaml.deprecated_argument x "Please use y instead!"] > [@@ocaml.deprecated_missing_argument x "Please pass y, it will soon b= e mandatory"] >=20 >=20 > Or indeed allow adding attributes on (labeled?) arguments, or interpret a= ttributes on their types. But internally, the information could always be = attached to the value binding, which should be simpler than storing it in t= he type. This is not so clear.=20 The binding information could be hard to bring to the application type infe= rence, while if it is contained in the label, it is already available where= it is needed. Also, attaching the deprecation to the binding means that we can only refe= r to the first optional argument with the same name. In theory, there could= be several, but I agree that this is going to be extremely rare. >> By deprecating the absence, do you mean having a warning when the argume= nt is ommited? >> Wouldn=E2=80=99t it mean having two distinct deprecation annotations for= optional arguments? >=20 > Yes, of course. "Old" attributes (that will be discarded at some point) = should be reported when they are passed a value; "new" attributes (that mig= ht become non-optional) should be reported when they are omitted. It remai= ns to be seen what to do with applications with the ?x syntax (i.e. passing= an option). I suppose ?x should raise a warning too, since it is intended to allow both= pasing and not passing, and one of the two is wrong. Jacques --=20 Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs=