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 E53277EE7D for ; Wed, 3 Jun 2015 00:23:32 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of nils.becker@bioquant.uni-heidelberg.de) identity=pra; client-ip=129.206.210.211; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="nils.becker@bioquant.uni-heidelberg.de"; x-sender="nils.becker@bioquant.uni-heidelberg.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of nils.becker@bioquant.uni-heidelberg.de) identity=mailfrom; client-ip=129.206.210.211; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="nils.becker@bioquant.uni-heidelberg.de"; x-sender="nils.becker@bioquant.uni-heidelberg.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@relay2.uni-heidelberg.de) identity=helo; client-ip=129.206.210.211; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="nils.becker@bioquant.uni-heidelberg.de"; x-sender="postmaster@relay2.uni-heidelberg.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BTBAAqLG5VnNPSzoFbgyWEO8MxAoFAPBABAQEBAQEBEQEBAQEBCAsJCSEuQQWDXQEBBCNVESUCBRYLAgIJAwIBAgE/BhMIAQGIKQS2QBNjLQ2iSSyBIY8vFoJSgUUFpiuPRIQdgzQBAQE X-IPAS-Result: A0BTBAAqLG5VnNPSzoFbgyWEO8MxAoFAPBABAQEBAQEBEQEBAQEBCAsJCSEuQQWDXQEBBCNVESUCBRYLAgIJAwIBAgE/BhMIAQGIKQS2QBNjLQ2iSSyBIY8vFoJSgUUFpiuPRIQdgzQBAQE X-IronPort-AV: E=Sophos;i="5.13,541,1427752800"; d="scan'208";a="133171947" Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Jun 2015 00:23:32 +0200 Received: from ix.urz.uni-heidelberg.de (cyrus-portal01.urz.uni-heidelberg.de [129.206.100.97]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t52MNUZF016004 for ; Wed, 3 Jun 2015 00:23:31 +0200 Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (Postfix) with ESMTPS id BF17D2272DBB for ; Wed, 3 Jun 2015 00:23:30 +0200 (CEST) Received: from MacBook-Pro.local (HSI-KBW-046-005-150-158.hsi8.kabel-badenwuerttemberg.de [46.5.150.158]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id t52MNT48023011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 3 Jun 2015 00:23:30 +0200 Message-ID: <556E2CE1.9040801@bioquant.uni-heidelberg.de> Date: Wed, 03 Jun 2015 00:23:29 +0200 From: Nils Becker User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: caml-list@inria.fr References: <20150602100015.E87D67EEF7@sympa.inria.fr> In-Reply-To: <20150602100015.E87D67EEF7@sympa.inria.fr> OpenPGP: id=C2CF0B41A8FCDE9FAA305E9A2DFCC3F4AF475A7D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Validation-by: nils.becker@bioquant.uni-heidelberg.de Subject: [Caml-list] pattern matching on mapped lists I find this syntax handy let [ii; jj] = List.map float_of_int [i; j] in ... do stuff with the floats because it avoids repeating the function call. The compiler lets this pass but warns that the matching is not exhaustive since [] is not matched. This actually can't happen if I'm not mistaken. So, is this considered good style, or is there a better idiomatic way to do multiple assignments? If yes, should this be an enhancement request for the type checker? n.