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 7D8AE7EE5B for ; Sun, 25 May 2014 12:30:30 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ollie.frolovs.2012@my.bristol.ac.uk) identity=pra; client-ip=74.125.82.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ollie.frolovs.2012@my.bristol.ac.uk"; x-sender="ollie.frolovs.2012@my.bristol.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ollie.frolovs.2012@my.bristol.ac.uk) identity=mailfrom; client-ip=74.125.82.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ollie.frolovs.2012@my.bristol.ac.uk"; x-sender="ollie.frolovs.2012@my.bristol.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f176.google.com) identity=helo; client-ip=74.125.82.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ollie.frolovs.2012@my.bristol.ac.uk"; x-sender="postmaster@mail-we0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocBAL7FgVNKfVKwlGdsb2JhbABZxzcWDgEBAQEHCwsJEiqCPoF8AQUBIjWIIAQBpAqDEWqqIIVDF5IEgRUEoF6KS0GEaQ X-IPAS-Result: AocBAL7FgVNKfVKwlGdsb2JhbABZxzcWDgEBAQEHCwsJEiqCPoF8AQUBIjWIIAQBpAqDEWqqIIVDF5IEgRUEoF6KS0GEaQ X-IronPort-AV: E=Sophos;i="4.98,905,1392159600"; d="scan'208";a="76074408" Received: from mail-we0-f176.google.com ([74.125.82.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 25 May 2014 12:30:30 +0200 Received: by mail-we0-f176.google.com with SMTP id q59so6586110wes.7 for ; Sun, 25 May 2014 03:30:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; bh=14YUfBOZ62FnpgrjTvdXUDIax8OI53b7DZg/7b9LpTY=; b=AQ2MXbU9tvvLV2/vGfRri/gZP2UpIkcqXfhb41bqzpEFQ9xnW780S2AWzUgVGM/MWx hXsL0kIUwDa1+gt7v90SQAQGlMHPLzU5VYJftF+g2svSNDB3aNeyJI+GfDg43St3CRtA NWOpIzTpq/ar/lyMwORdX7sI5LWzt0dY9UYrMQG4fp2hJjQJpP2hrcVDuyv3bFaUnwIP QFbLiSeBw/YXswDQ0sTIFhUQomzZst1MJQraNEDT5SimqIWDAI+Wi/x3IHXSAnfxH0Yy HiraDS3xgrJjKKI0R26CNVfReO503vptBIsX+WsOnYUOzFqmTM3bo2gN6n9ccF82OHDT KtKQ== X-Gm-Message-State: ALoCoQmLN6r8W6jlbFi7vWHh9qIwG6gAKgllYhbjJoA9pMDyHdAUUPx4WpfoWoXA5cPNJxaOCIIQ X-Received: by 10.194.89.40 with SMTP id bl8mr2614496wjb.90.1401013829772; Sun, 25 May 2014 03:30:29 -0700 (PDT) Received: from [192.168.0.12] ([2.220.224.146]) by mx.google.com with ESMTPSA id ho2sm17196528wib.15.2014.05.25.03.30.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 25 May 2014 03:30:28 -0700 (PDT) From: Ollie Frolovs Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Message-Id: <52C51721-8564-472C-AA7A-2ABE66C4D809@my.bristol.ac.uk> Date: Sun, 25 May 2014 11:30:20 +0100 To: caml users Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) X-Mailer: Apple Mail (2.1878.2) X-Validation-by: ollie.frolovs.2012@my.bristol.ac.uk Subject: [Caml-list] Modules and record fields Hello I was using some colours in my program and thought that it would be a good = idea to put colour constants into a separate module.=20 module Solarized =3D struct type colour =3D {r:int; g:int; b:int} let base03 =3D {r=3D0x00; g=3D0x2b; b=3D0x36} let orange =3D {r=3D0xcb; g=3D0x4b; b=3D0x16} (* etc etc *) end I need three separate RGB components because I=92m using an API which needs= them separately, rather than in some pre-packed way. I was planning to use the module like this let module S =3D Solarized in Sdl.set_render_draw_color ren S.orange.r S.orange.g S.orange.b 0xff (* etc etc *) that is, to locally open the module and refer to the colours and their subc= omponent. But this does not work. It appears for some reason that I have to address t= he subcomponents as Solarized.orange.Solarized.r which defeats the purpose! Is there any other way to achieve my goal? Best regards Ollie=20=