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 72E955D4 for ; Thu, 6 Sep 2018 11:36:35 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.53,337,1531778400"; d="scan'208";a="345227153" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 06 Sep 2018 13:36:32 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 7D37D824DB; Thu, 6 Sep 2018 13:36:32 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 37C4E824B2 for ; Thu, 6 Sep 2018 13:36:24 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=enrico.tassi@inria.fr; spf=None smtp.mailfrom=gares@fettunta.org; spf=None smtp.helo=postmaster@fettunta.org IronPort-PHdr: =?us-ascii?q?9a23=3Ar1fI+x/jkFcM1/9uRHKM819IXTAuvvDOBiVQ1KB5?= =?us-ascii?q?2u0cTK2v8tzYMVDF4r011RmVBdqds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2O2+55/ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRhHohi?= =?us-ascii?q?kZKjA3827YhdBtg61Vux+huwBzzpTIbI2JLvdyYKXQds4aS2pbWcZRUjRMDIy6?= =?us-ascii?q?b4sVDuoOIeFYpJTjqVQUthu+HgisD/7oxzBWgH/2x6w63PgmEQ3cwAwvBckOsG?= =?us-ascii?q?/VrNjuNacSV/q1zKjSwjnZYfNWwy7w5Y7VeR4iufGBRbZ9fMXLxUUxGQ7JlFSd?= =?us-ascii?q?pIj/Mz+IyOgAsXCX4/duWO+skWIqrwB8riKgy8ookIXFmI0Yx1HC+C5k2og6P8?= =?us-ascii?q?e4R1R+YdO8EJtfqSWaN4xuT8MsXW5opDo6yqAAuZ6nZicG0pMnxwTQa/CfcoiI?= =?us-ascii?q?5AzsVPqJLDp8i39pYqyzihio/UWhzuDwTNS43EhIoyZdl9nDrHEN1xjd6sidTf?= =?us-ascii?q?t9+1+s2TmV2ADJ9O5EOls5laTFJJ493r4wi5wTsVjZESPsn0X2lqCWel0++ue0?= =?us-ascii?q?8+TnfqnmppiEOoBokA7+N6AultW7AeQ5KQgOQ3OW+f+81b3m5U32Wq9Gjvwwkq?= =?us-ascii?q?nDsZDVP94XpqCjA1wd7oF24B+6C3Ki0c8EtXgBNlNMPhyd3KbzPFSbDfbiDPy4?= =?us-ascii?q?y2iliyxqj6TLOKfgCZKLMnHYi7bJfLBn6kcaxhBlnoMX3I5dFrxUeKG7YUT2rt?= =?us-ascii?q?GNVkZoYTzx+P7uDZBG7q1bXGuOBqGDN6aL7Q2G6/4zPu+QbckSojmvc6F5tc6r?= =?us-ascii?q?tmcwnBomRYfsxYEeMSjqH/J8Ikzfb2C+2o5cQ1dPhRI3SanRsHPHUTNXYC/uDa?= =?us-ascii?q?wx+i0mDp6vS4DZSdL1jQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AtGgACEJFb/39FF15aHgEGDINOgWQVj?= =?us-ascii?q?HaLUo83iQYTghwBhDsDg1sZBgY3EQECAQECAQEBAQFsKII1IoMiezQthVcEozu?= =?us-ascii?q?KBYpegVg/g3aEdIEFhQsCm3EHAn9TMQSNbSIJjl6VVwUZgVUzGidMgm2QVIFiB?= =?us-ascii?q?AGMbQEB?= X-IPAS-Result: =?us-ascii?q?A0AtGgACEJFb/39FF15aHgEGDINOgWQVjHaLUo83iQYTghw?= =?us-ascii?q?BhDsDg1sZBgY3EQECAQECAQEBAQFsKII1IoMiezQthVcEozuKBYpegVg/g3aEd?= =?us-ascii?q?IEFhQsCm3EHAn9TMQSNbSIJjl6VVwUZgVUzGidMgm2QVIFiBAGMbQEB?= X-IronPort-AV: E=Sophos;i="5.53,337,1531778400"; d="scan'208";a="345227114" Received: from fettunta.org ([94.23.69.127]) by mail2-smtp-roc.national.inria.fr with ESMTP; 06 Sep 2018 13:36:23 +0200 Received: from gargamel.invalid (eduroam-246c.sophia.inria.fr [138.96.49.246]) by fettunta.org (Postfix) with ESMTPSA id E4847D7FA for ; Thu, 6 Sep 2018 13:36:22 +0200 (CEST) Received: from gares by gargamel.invalid with local (Exim 4.89) (envelope-from ) id 1fxsaE-0006PR-IE for caml-list@inria.fr; Thu, 06 Sep 2018 13:36:22 +0200 Date: Thu, 6 Sep 2018 13:36:22 +0200 From: Enrico Tassi To: caml-list@inria.fr Message-ID: <20180906113622.lcuamhs6g6juv2r5@gargamel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Subject: [Caml-list] How to rename a record field Reply-To: Enrico Tassi X-Loop: caml-list@inria.fr X-Sequence: 17050 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: Dear caml-list, while refining an API I felt the need to rename a record field. I'd like to be nice to my users and have the API evolve without breaking compilation but eventually emitting deprecation warnings. What I'd like to do, concretely is to move from this record t = { bad : int; stuff : ty } to record old = { bad : int [@deprecated "use good"]; stuff : ty } record t = old = { good : int; stuff : ty } The last line does not type check since old and good are different names. What I'd like to obtain is to have bad and good act as synonyms, and have OCaml generate a warning when bad is used. This is pretty much what you would do for a function: leave the old one in place and stick a deprecate attribute to it. Is there a way to achieve that for records? Best, -- Enrico Tassi -- 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