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 6F5C07F616 for ; Wed, 22 Feb 2017 18:53:24 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rich@annexia.org; spf=Pass smtp.mailfrom=rich@annexia.org; spf=Pass smtp.helo=postmaster@annexia.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rich@annexia.org) identity=pra; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rich@annexia.org designates 80.68.91.176 as permitted sender) identity=mailfrom; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@annexia.org designates 80.68.91.176 as permitted sender) identity=helo; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="postmaster@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AEhKaQx198Dw0xH1ssmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?se0QK/ad9pjvdHbS+e9qxAeQG96KtrQd1aGP6/yocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZr?= =?us-ascii?q?KeTpAI7SiNm82/yv95HJbQhFgDqwbalvIBi3ogndq9UajIR/Iast1xXFpWdFdf?= =?us-ascii?q?5Lzm1yP1KTmBj85sa0/JF99ilbpuws+c1dX6jkZqo0VbNXAigoPGAz/83rqALM?= =?us-ascii?q?TRCT6XsGU2UZiQRHDg7Y5xznRJjxsy/6tu1g2CmGOMD9UL45VSi+46ptVRTlkz?= =?us-ascii?q?kMOSIn/27Li8xwlKNbrwynpxxj2I7ffYWZOONjcq/BYd8WQGxMVdtTWSNcGIOx?= =?us-ascii?q?d4UBAeofM+hFrIf9qVQBogejCgejBuzgxCRFhmP10KAgz+gtDRvL0BEmEtkTsH?= =?us-ascii?q?rUttL1NKIKXOy70KfIzCnMb/NM1jfn9YfDbxAureuLU75qbMHfzU4vFwXbgVWL?= =?us-ascii?q?p4DuIjSY1v4Ms2eH7+ptTvigi2ghqw5vrTmvx90jhpPOhoIPxVDJ7CN0y5s2K9?= =?us-ascii?q?2gUEN2YsKoHIFRuiyZLYd7Rt4uT3t1tCs4y7ALv4OwcjIQx5Q93RHfbuSKc4iW?= =?us-ascii?q?7RLnU+acOS13hHRjeL2hiBey8FKvxvf7Vsmu31ZGtitFkt/SuXARzxHe6dSLRu?= =?us-ascii?q?F880qiwzqC0x3f5vtZLU02lKfXM5shzaQxlpoXv0TDBCj2mEDuga+Md0Ur5uio?= =?us-ascii?q?5v/9bbXgoJ+TKYB1igDkPag0ncy/G+s4PhAUX2eH4eS8yKHj/UrhTbpWlPI2l6?= =?us-ascii?q?3ZvIneJcQava65HxRY0p0j6ha6Fzepys4UnXgBLFJfeRKIlZLlO1/UIKOwMfDq?= =?us-ascii?q?pVWnlzPi3MfhPLDtC6LnomKLxLHgdrF54lUazwg+wdkZ7ZtOIrUMMPP9Wwn6s9?= =?us-ascii?q?mOXTEjNAnhidzmA9V0zI9WZiSqROe7N6XfqhXAsvguKOmkbYkTtSb8Ir4i/fG4?= =?us-ascii?q?3ixxokMUYaT8hchfU3u/BPkzZhzBOXc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DYAwDhzq1Y/7BbRFBeGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgyaEd5sCAQEBAQEBBoEilTSCDYYiAoMFQRY?= =?us-ascii?q?BAQEBAQEBAQEBAWEogjMiAYIbAQUyAUYQCxgJExIPBSghiXsRsUOLNgELJoYHO?= =?us-ascii?q?4R5ijkFj0yMRAGSFYFwAY8skyUmATCBAGEIPoZJQIpJAQEB?= X-IPAS-Result: =?us-ascii?q?A0DYAwDhzq1Y/7BbRFBeGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgyaEd5sCAQEBAQEBBoEilTSCDYYiAoMFQRYBAQEBAQEBAQEBA?= =?us-ascii?q?WEogjMiAYIbAQUyAUYQCxgJExIPBSghiXsRsUOLNgELJoYHO4R5ijkFj0yMRAG?= =?us-ascii?q?SFYFwAY8skyUmATCBAGEIPoZJQIpJAQEB?= X-IronPort-AV: E=Sophos;i="5.35,195,1484002800"; d="scan'208";a="214388567" Received: from annexia.org ([80.68.91.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 22 Feb 2017 18:53:23 +0100 Received: from rich by annexia.org with local (Exim 4.84_2) (envelope-from ) id 1cgb6O-0001wK-SR; Wed, 22 Feb 2017 17:53:20 +0000 Date: Wed, 22 Feb 2017 17:53:20 +0000 From: "Richard W.M. Jones" To: =?iso-8859-1?Q?Nicol=E1s_Ojeda_B=E4r?= Cc: Gabriel Scherer , caml users Message-ID: <20170222175320.GH28111@annexia.org> References: <20170222170101.GE28111@annexia.org> <20170222173645.GF28111@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [Caml-list] List of structurally typed objects On Wed, Feb 22, 2017 at 06:43:06PM +0100, Nicolás Ojeda Bär wrote: > Hi Richard, > > Note that you can still write < hello: string; .. > in the signature of > register_obj and do the cast before adding your object to the list: > > let register_obj name obj = objs := (name, (obj :> < hello: string >)) :: > !objs > > This way you do not need to downcast at each call-site of register_obj. Indeed, that will make my code simpler too. Thanks, Rich.