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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 314AF7FE44 for ; Fri, 8 Jul 2016 10:08:55 +0200 (CEST) IronPort-PHdr: 9a23:sGWY9Rwljs3qpC/XCy+O+j09IxM/srCxBDY+r6Qd0OsfIJqq85mqBkHD//Il1AaPBtSDragVwLOP7OjJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMzfbWtXNSDxJ3uiKibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtLYqySlbuuog+shcSu26Ov1gFf0LOg87KHg479HHshzKTA3HpidNEzZerh0dOQ/J6xXiXpq5libit+Vn1WHOJ8r6SrQsWTnk66pzSRDyhQ8aMT8ntXrelMtxgeRVukTyiQZ4xtvyYYqSMPNlNoTfcN8TDUBIRI4FUS1KBYe1dM0IDecNNKBSppPVo1YerBW/QwKrAbW8mXdzmnbq0PhigKwaGgbc0VllQosD Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=nicolas.ojeda.bar@lexifi.com; spf=None smtp.mailfrom=nicolas.ojeda.bar@lexifi.com; spf=None smtp.helo=postmaster@mx30.yaziba.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of nicolas.ojeda.bar@lexifi.com) identity=pra; client-ip=82.138.71.21; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="nicolas.ojeda.bar@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of nicolas.ojeda.bar@lexifi.com) identity=mailfrom; client-ip=82.138.71.21; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="nicolas.ojeda.bar@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mx30.yaziba.net) identity=helo; client-ip=82.138.71.21; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="postmaster@mx30.yaziba.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A/AQAwX39XfRVHilJbFoN+fAEFp2CTLSKFdgKBJgc8EAEBAQEBAQEBEQEBCxQJUIIyghsBBAESEQRHCwULCwQHBRUdAgIiEgEFAQoSBhMSEId0Aw8IBAqfa4ExPjGLO4sSA4QwAQEBAQYBAQEBAQEhinSHQoJaBYZSDJI2hguIQoI4jHSOThIegQ0CDyaEEmyJFgEBAQ X-IPAS-Result: A0A/AQAwX39XfRVHilJbFoN+fAEFp2CTLSKFdgKBJgc8EAEBAQEBAQEBEQEBCxQJUIIyghsBBAESEQRHCwULCwQHBRUdAgIiEgEFAQoSBhMSEId0Aw8IBAqfa4ExPjGLO4sSA4QwAQEBAQYBAQEBAQEhinSHQoJaBYZSDJI2hguIQoI4jHSOThIegQ0CDyaEEmyJFgEBAQ X-IronPort-AV: E=Sophos;i="5.28,328,1464645600"; d="scan'208,217";a="184250777" Received: from mx30.yaziba.net ([82.138.71.21]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Jul 2016 10:08:48 +0200 Received: from mta20.int.yaziba.net (unknown [217.117.151.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx30.yaziba.net (mx10.yaziba.net) with ESMTPS id B20531A79AB for ; Fri, 8 Jul 2016 10:08:47 +0200 (CEST) Received: from mta20.int.yaziba.net (localhost [127.0.0.1]) by mta20.int.yaziba.net (Postfix) with ESMTPS id C8C58CA747 for ; Fri, 8 Jul 2016 10:08:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mta20.int.yaziba.net (Postfix) with ESMTP id B8E98CA755 for ; Fri, 8 Jul 2016 10:08:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at mta20.int.yaziba.net Received: from mta20.int.yaziba.net ([127.0.0.1]) by localhost (mta20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2E9tguII8fCb for ; Fri, 8 Jul 2016 10:08:47 +0200 (CEST) Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) by mta20.int.yaziba.net (Postfix) with ESMTPSA id 62178CA747 for ; Fri, 8 Jul 2016 10:08:47 +0200 (CEST) Received: by mail-qk0-f177.google.com with SMTP id t127so33946909qkf.1 for ; Fri, 08 Jul 2016 01:08:47 -0700 (PDT) X-Gm-Message-State: ALyK8tK0e7Wh+gc2hMmnPaisTGUsSXxcYlQM/hiad9OH5PQSbS9KrxKCloBvQf7rOKxN0Q6JyCvKXeViR9NNDg== X-Received: by 10.55.161.73 with SMTP id k70mr5629121qke.189.1467965326163; Fri, 08 Jul 2016 01:08:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.49.2 with HTTP; Fri, 8 Jul 2016 01:08:26 -0700 (PDT) In-Reply-To: <20160708080134.GK11971@HPArchRod.localdomain> References: <20160708080134.GK11971@HPArchRod.localdomain> From: Nicolas Ojeda Bar Date: Fri, 8 Jul 2016 10:08:26 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Rodolphe Lepigre Cc: OCaml Mailing List Content-Type: multipart/alternative; boundary=94eb2c0762c2cf09f505371b4fe4 X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -51 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeeltddrfedtucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdgjtegkkfeuteenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegoufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepjghfhfffkffuvfgtsegrtderredttdejnecuhfhrohhmpefpihgtohhlrghsucfqjhgvuggruceurghruceonhhitgholhgrshdrohhjvggurgdrsggrrheslhgvgihifhhirdgtohhmqeenucffohhmrghinhepuhhnihhvqdhsmhgsrdhfrhdpihhnrhhirgdrfhhrpdihrghhohhordgtohhmnecukfhppedvtdelrdekhedrvddvtddrudejjeenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Printf.sprintf "%a" --94eb2c0762c2cf09f505371b4fe4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Rodolphe, I don't think this is possible with Printf. But if you can switch to Format you can use Format.asprintf instead. Cheers, Nicolas On Fri, Jul 8, 2016 at 10:01 AM, Rodolphe Lepigre < rodolphe.lepigre@univ-savoie.fr> wrote: > Dear list, > > If I define two values > > val p : type out_channel -> blop -> unit > val e : blop > > then I can do something like > > Printf.printf "%a" p e > > but I can't find a way to do something like > > Printf.sprintf "%a" p e > > which is not well-typed. Is there any trick that I can use to avoid > changing the type of [p] to [blop -> string]? > > Cheers, > > Rodolphe > -- > Rodolphe Lepigre > LAMA, Universit=C3=A9 Savoie Mont Blanc, FRANCE > http://lama.univ-smb.fr/~lepigre/ > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --94eb2c0762c2cf09f505371b4fe4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Rodolphe,

I don't think this is = possible with Printf.=C2=A0 But if you can switch to Format you can use For= mat.asprintf instead.

Cheers,
Nicolas


On Fri, Jul 8, 2016 at 10:01 AM, Rodolphe Lepigre = <ro= dolphe.lepigre@univ-savoie.fr> wrote:
Dear list,

If I define two values

=C2=A0 val p : type out_channel -> blop -> unit
=C2=A0 val e : blop

then I can do something like

=C2=A0 Printf.printf "%a" p e

but I can't find a way to do something like

=C2=A0 Printf.sprintf "%a" p e

which is not well-typed. Is there any trick that I can use to avoid
changing the type of [p] to [blop -> string]?

Cheers,

Rodolphe
--
Rodolphe Lepigre
LAMA, Universit=C3=A9 Savoie Mont Blanc, FRANCE
http://lama.univ-smb.fr/~lepigre/

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--94eb2c0762c2cf09f505371b4fe4--