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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id EEA217EE49 for ; Sun, 15 Sep 2013 12:30:52 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of j.romildo@gmail.com) identity=pra; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="j.romildo@gmail.com"; x-sender="j.romildo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of j.romildo@gmail.com designates 209.85.213.180 as permitted sender) identity=mailfrom; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="j.romildo@gmail.com"; x-sender="j.romildo@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ye0-f180.google.com) identity=helo; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="j.romildo@gmail.com"; x-sender="postmaster@mail-ye0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjADAIaLNVLRVdW0nGdsb2JhbABbhnSxb4EMhVOGTxYOAQEBAQEGDQkJFCiCZgYBGx4DEiY0BQ8JCAEFAS6HdwEDDwKZKYMDjFGDB4NnChknDWSISQEFDI4UgXCDCIEAA5d6hkwCiT5BhGaBVw X-IPAS-Result: AjADAIaLNVLRVdW0nGdsb2JhbABbhnSxb4EMhVOGTxYOAQEBAQEGDQkJFCiCZgYBGx4DEiY0BQ8JCAEFAS6HdwEDDwKZKYMDjFGDB4NnChknDWSISQEFDI4UgXCDCIEAA5d6hkwCiT5BhGaBVw X-IronPort-AV: E=Sophos;i="4.90,909,1371074400"; d="scan'208";a="32927892" Received: from mail-ye0-f180.google.com ([209.85.213.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 15 Sep 2013 12:30:51 +0200 Received: by mail-ye0-f180.google.com with SMTP id m15so1168522yen.39 for ; Sun, 15 Sep 2013 03:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=MJ3TTsI5x5shAGa57Vnyf8yAopWrkEMLYoxH2ssA0+w=; b=paDLtVaj4y3s+YxekuqIpGDWejv2WA0jHgnzVjfivWeh7RcETkQXQL7N+z+8q93PE5 p5Mh4hvUZE1Na7Xl6BoUPQ0iBsveqjOoyoUqoEXmDzFwBl5zIoCf+mI6kJ8q0D43Q9E9 v9vd763FV5TlfJ4O28ko96XhpShuWsTz3GsSkt3AK6jg6RvoyY7u4cx/4zUyXjMM1QMR G6KfcGX5vGrMz379l2QqOiSqq3rJcEKECtEnNTTwT29/tn8aAtIRhBsdY1MaifTndHUD u1wEW8p7DEbGRB/KrKN+i5jDxF13A8S2x7OzM9rP0OpX8RBCnJWskuyezkMX6XZu/6zT 4vMg== X-Received: by 10.236.130.138 with SMTP id k10mr19388550yhi.31.1379241051013; Sun, 15 Sep 2013 03:30:51 -0700 (PDT) Received: from jrm.localdomain (187-127-253-80.user.veloxzone.com.br. [187.127.253.80]) by mx.google.com with ESMTPSA id v22sm26433133yhn.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Sep 2013 03:30:50 -0700 (PDT) Received: by jrm.localdomain (Postfix, from userid 1000) id B3D7FEED5B; Sun, 15 Sep 2013 07:30:27 -0300 (BRT) Date: Sun, 15 Sep 2013 07:30:27 -0300 From: =?iso-8859-1?Q?Jos=E9?= Romildo Malaquias To: caml-list@inria.fr Message-ID: <20130915103027.GA21344@jrm> Mail-Followup-To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [Caml-list] Accessing record fields Hello. OCaml offers at least two ways of accessing a record field: using the dot notation, and doing pattern matching. Does one of them deliver better performance than the other? This may be relevant when a field is accessed multiple times. For instance: type trec = { a : int; mutable b: int } let f {a;b} = a * a + b let g r = r.a * r.a + r.b Which one would be preferred in this case: f or g? Romildo