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 B4A8C7F860 for ; Thu, 6 Mar 2014 17:34:52 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of matthieu.dubuget@gmail.com) identity=pra; client-ip=209.85.214.50; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="matthieu.dubuget@gmail.com"; x-sender="matthieu.dubuget@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of matthieu.dubuget@gmail.com designates 209.85.214.50 as permitted sender) identity=mailfrom; client-ip=209.85.214.50; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="matthieu.dubuget@gmail.com"; x-sender="matthieu.dubuget@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-bk0-f50.google.com) identity=helo; client-ip=209.85.214.50; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="matthieu.dubuget@gmail.com"; x-sender="postmaster@mail-bk0-f50.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsBAFyiGFPRVdYynGdsb2JhbABaxlAWDgEBAQEBBg0JCRQogl4BDQEbHAIDEhAWFhgDAgECARERAQUBIg0IAQGHYAEDEQQBnyeDDYxfgw6VSAoZJw1khiIBBQyTDgSYPoZKiXNBhFs X-IPAS-Result: AvsBAFyiGFPRVdYynGdsb2JhbABaxlAWDgEBAQEBBg0JCRQogl4BDQEbHAIDEhAWFhgDAgECARERAQUBIg0IAQGHYAEDEQQBnyeDDYxfgw6VSAoZJw1khiIBBQyTDgSYPoZKiXNBhFs X-IronPort-AV: E=Sophos;i="4.97,601,1389740400"; d="scan'208";a="61605006" Received: from mail-bk0-f50.google.com ([209.85.214.50]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 06 Mar 2014 17:34:52 +0100 Received: by mail-bk0-f50.google.com with SMTP id w10so736477bkz.23 for ; Thu, 06 Mar 2014 08:34:51 -0800 (PST) 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 :content-type:content-transfer-encoding; bh=frZziKNkVOpYoFktLjguSPAdfeBiWte3Orgr1RLVlD0=; b=qUKK5iZw0cmFjVRvOsKdSx3uxpy8tshzoQZSoRYp7zcvPZaeY58fM86JwLUTdig8HE O/5c1vXp8PLUnSF9NVTuKTHexyrrL5P7kqhmjE3R4d4pNcuFezx3OwFCMg+cYIgcvvXk S+eZMEBKZFSlHQOFtV6RA6Zbohjj+Z4l3b3lgVCB3nI86Inuc6td3ttdcnMaAEOOcOvc FMkxrQpGtKsi4cQTM3lIfHYTDc+HIX2/AgOdJPPmxv573X0XZCxb9FqVUIC4ldTdwuXG 5PwykpOVx7qDyykHCtXKRmE2yxCUglRnRi1TdxHdIbTTbaNtqG4y9b5d8wHD4SXl2u0H AadA== X-Received: by 10.205.98.194 with SMTP id cp2mr3788848bkc.12.1394123691683; Thu, 06 Mar 2014 08:34:51 -0800 (PST) Received: from [172.17.1.25] (papillon.metalscan.fr. [178.22.148.54]) by mx.google.com with ESMTPSA id u14sm10069415bkg.9.2014.03.06.08.34.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 08:34:50 -0800 (PST) Message-ID: <5318A3A8.8050402@gmail.com> Date: Thu, 06 Mar 2014 17:34:48 +0100 From: Matthieu Dubuget User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: caml-list X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: [Caml-list] I never succeeded in using Format Is the following behaviour expected, or a misunderstanding of mine? In short, I'd like to use the Format module to prepare an output inside a Buffer.t. But a basic box does not break lines as I would expect, while printf does. OCaml version 4.01.0 # open Format;; # printf "@[111,@,222,@,333,@,444,@,555,@,666@]@.";; 111,222,333,444,555,666 - : unit = () # set_margin 9;; - : unit = () # printf "@[111,@,222,@,333,@,444,@,555,@,666@]@.";; 111,222, 333,444, 555,666 - : unit = () # sprintf "@[111,@,222,@,333,@,444,@,555,@,666@]@.";; - : string = "111,222,333,444,555,666\n" Why doesn't sprintf exhibit the same behaviour as printf? Trying with fprintf… # fprintf str_formatter "@[111,@,222,@,333,@,444,@,555,@,666@]@.";; - : unit = () # flush_str_formatter ();; - : string = "111,222,333,444,555,666\n" -- Matthieu Dubuget