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 491927F84F for ; Sat, 15 Feb 2014 16:06:17 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=80.12.242.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=80.12.242.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.smtpout.orange.fr) identity=helo; client-ip=80.12.242.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@smtp.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUCACuC/1JQDPJ9lGdsb2JhbABZDsA9gwaBJA4BAQEBBwsLCRIqgiUBAQU4UQsYCSUPAkYGAQwIAQGIBckiF48IhDgBA5RDg2mGR45KQA X-IPAS-Result: AnUCACuC/1JQDPJ9lGdsb2JhbABZDsA9gwaBJA4BAQEBBwsLCRIqgiUBAQU4UQsYCSUPAkYGAQwIAQGIBckiF48IhDgBA5RDg2mGR45KQA X-IronPort-AV: E=Sophos;i="4.95,850,1384297200"; d="scan'208";a="58659090" Received: from smtp03.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) ([80.12.242.125]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Feb 2014 16:05:50 +0100 Received: from [192.168.1.12] ([92.154.125.156]) by mwinf5d58 with ME id Sf5q1n0043NazDY03f5qcs; Sat, 15 Feb 2014 16:05:50 +0100 Message-ID: <52FF8250.30607@frisch.fr> Date: Sat, 15 Feb 2014 16:05:52 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Christophe Troestler , OCaml Mailing List References: <20140214.082352.48621319473754158.Christophe.Troestler@umons.ac.be> <20140215.152342.1020588167010524975.Christophe.Troestler@umons.ac.be> In-Reply-To: <20140215.152342.1020588167010524975.Christophe.Troestler@umons.ac.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] First class modules from C On 2/15/2014 3:23 PM, Christophe Troestler wrote: > When passing a packed module to a C function, do we access its values > as if it was a record (in the order of the signature) or is it more > complicated? A description in the user manual would be nice! Yes, currently, this is how a first-class module is represented, and you need to know exactly what in the signature count for one slot. But this representation is not specified, and not guaranteed to remain like that in future versions (in particular, it might very well be the case that first-class modules would receive an extra unique identifier field, to be used by the generic hash/compare functions). It seems more robust to access components from an OCaml function (called from C, if needed, or applied before/instead passing the packed module to C). -- Alain