From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <5764c029b688c1c0d24a2e97cd764f@gmail.com> 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 61DA380977 for ; Mon, 3 Jun 2013 13:05:53 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com) identity=pra; client-ip=209.85.214.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com designates 209.85.214.47 as permitted sender) identity=mailfrom; client-ip=209.85.214.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f47.google.com) identity=helo; client-ip=209.85.214.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="postmaster@mail-bk0-f47.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8BAIRzrFHRVdYvjWdsb2JhbABZgh4EhAy9DhYOAQEBAQcLCwkSBiSCagEbHAIDEhAWFhgDAgECARERAQUBIgEMCAKHdgEDDwSdRIxKgn2EHwoZJw1YiCUBBQyNU4UnA5c+hh6JPT+ENg X-IPAS-Result: Aj8BAIRzrFHRVdYvjWdsb2JhbABZgh4EhAy9DhYOAQEBAQcLCwkSBiSCagEbHAIDEhAWFhgDAgECARERAQUBIgEMCAKHdgEDDwSdRIxKgn2EHwoZJw1YiCUBBQyNU4UnA5c+hh6JPT+ENg X-IronPort-AV: E=Sophos;i="4.87,791,1363129200"; d="scan'208";a="16560819" Received: from mail-bk0-f47.google.com ([209.85.214.47]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Jun 2013 12:45:29 +0200 Received: by mail-bk0-f47.google.com with SMTP id jg9so1434904bkc.6 for ; Mon, 03 Jun 2013 03:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=+rn3APZ1/sp2jfda9Ql1L463MSHV2xhJdwkET+tWxCc=; b=Y1VgVmN4vIJsIM4qq3uQg0WWKAvUtaQC6NJscnxMtUSCKUcF4bdIAabgTB9wbwIaon jbqxyGeYpIa/A67Ur14htNz5O04MjRTvQZPt84ejt0n32VQ04gNzSczkC2wOsi9wJTn/ iQodcdENUPCv0t9jeWCdMvr0+jLZM2yp53pag1jOoTgc8rkEDPQ8mnFdcJ/Evzmbqd9/ EfxTfvTdUX0DqrRoftxcA359an4Y3KyEttJwEcNaZ3pAJyCa7nUp73YHzwvRphbP3fhU CQQPnSVbetW4jF4D/zF8JGtfbrS+eLS7cYFRDt0NDsUJ5RRW1ApJLK2+ezHEmUO4Et/R XPUw== X-Received: by 10.205.36.79 with SMTP id sz15mr6243258bkb.94.1370256329102; Mon, 03 Jun 2013 03:45:29 -0700 (PDT) Received: from [172.27.6.180] ([213.106.240.92]) by mx.google.com with ESMTPSA id jy7sm11429039bkb.6.2013.06.03.03.45.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 03:45:28 -0700 (PDT) Message-ID: <51AC7440.8050001@gmail.com> Date: Mon, 03 Jun 2013 11:47:28 +0100 From: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: caml-list@inria.fr, Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Caml-list] Batteries: a question about Int32.pack, Int32.unpack Hi, I am currently looking at: Int32.pack Int32.unpack functions. If I try: open Batteries_uni let s = String.create 4 Int32.pack s 0 42_l; everything seems fine. However, if I try: let s = String.create 5 Int32.pack s 0 42_l; I am getting an exception: Fatal error: exception Failure("Int32.pack: pos + 4 not within string") I would like to ask: is this the expected behavior? Why doesn't /pack/ simply use the first 4 bytes to the string and ignore all the other bytes that may be part of the string?