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 38E957FE44 for ; Fri, 8 Jul 2016 10:16:30 +0200 (CEST) IronPort-PHdr: 9a23:HkAGiRMFP3yniZSyRX4l6mtUPXoX/o7sNwtQ0KIMzox0Kfz7rarrMEGX3/hxlliBBdydsKMczbCH+Pm6BiQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd+KyZ7mnLnopNX6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwuwwZgf8q9tZBXKPmZOx4COUAVHV1e1wysevqvh7HRBDHwXkRXmxeuBNSS1zD7Rr9Wp7q9Cz4u+Z0niOTJ+XyQKA1VzXk5KBuHkzGkiACYgQ+/GbTksx9xIZWuBOuvRE3l5TTbIaRLPpzOKfQZdIVX2dpQ8BQSWlaC527boZJAfBXbrUQlJX0u1Zb9Uj2PgKrHu66j2YQ3nI= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rlepigre@gmail.com; spf=Pass smtp.mailfrom=rlepigre@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f67.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rlepigre@gmail.com) identity=pra; client-ip=74.125.82.67; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rlepigre@gmail.com"; x-sender="rlepigre@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rlepigre@gmail.com designates 74.125.82.67 as permitted sender) identity=mailfrom; client-ip=74.125.82.67; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rlepigre@gmail.com"; x-sender="rlepigre@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-wm0-f67.google.com) identity=helo; client-ip=74.125.82.67; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rlepigre@gmail.com"; x-sender="postmaster@mail-wm0-f67.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CdAABhYH9Xf0NSfUpbFoN+fLsxhyk8EAEBAQEBAQEBEQEBCQsLCR8xgjKCGwEEARIRBAsBDQE4AQMBCwEFBRAKAgUhAgIPBSABBQEiNYd0Aw8IBAqfbIExPjGLO4REBYYiJw2ETwIGEHGDG4ILhE2HQoJaBZNahTqBWoQyiDmCQocHhW2OTzCBDzVVgQKCO2yJFgEBAQ X-IPAS-Result: A0CdAABhYH9Xf0NSfUpbFoN+fLsxhyk8EAEBAQEBAQEBEQEBCQsLCR8xgjKCGwEEARIRBAsBDQE4AQMBCwEFBRAKAgUhAgIPBSABBQEiNYd0Aw8IBAqfbIExPjGLO4REBYYiJw2ETwIGEHGDG4ILhE2HQoJaBZNahTqBWoQyiDmCQocHhW2OTzCBDzVVgQKCO2yJFgEBAQ X-IronPort-AV: E=Sophos;i="5.28,328,1464645600"; d="scan'208";a="184251863" Received: from mail-wm0-f67.google.com ([74.125.82.67]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 08 Jul 2016 10:16:29 +0200 Received: by mail-wm0-f67.google.com with SMTP id k123so3675668wme.2 for ; Fri, 08 Jul 2016 01:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=y99E9yynSQ3iH5mvLILGOWBa+moDDn2EDKSsszNP4UY=; b=ZNYF5CHVC0IfOnk72Q05/gsQu5Ufu/D1V25F8kPcqJJnYiPpxZuXad+D5dPhRLvJIc zoo177t4qt0fpqcEE3sE5QDCvndSDEMmVICetUau8RNRXcHlKJGtj+xWJ/tOcgPUWWUH ABArtvixSlQ6ZSl0gLJKTw7Fe1H0sdUTOp3hsTCslIeCVnhFxY8BLayj+J8JL6fLP6D/ xhobsxK6h6bT3KzMy5qXYVe8RJ2fZuhg02oIhlGbT+wxXQD3QJ8PdYw010hAtL0tNyZD V3at+VxEGO0YoMsgRsCrvs9VSf4H9W2g1Wu223nYnTJHiPMcLXZOS0XoMoWwJpAj7dNR Jz+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=y99E9yynSQ3iH5mvLILGOWBa+moDDn2EDKSsszNP4UY=; b=SzKKvbsLJ+fHBt+/p+fneKHQITKmph2/KPpyxz+RJi2jy1Mo/UaiRPgseopwOsQdyD MzLfWBxbIFVUI8oMFyAR26mIoer86cCztCPz7dIZ1+GMC8477yh0JYbAob9IXq6u4CB0 KH2T+2ujS+2gkhp7xNOHbOFJymrryKhZpdoum5MfA/1ODGuZ16dCftNnTk1sP8/9+lTY xYLn3XHFKSL/UEQ1PKqH0QwSwXl7eRPSj8esNXwv35NT29gV0UMFXB0lPcBfbUDi0wnx GhHy+e3Ur1SoN3eLPvER1AiKJ1Ap6d4hbUCDrmGUUDP8Dk+Vj+fZkxPhV9f8Q9stQysZ Oe0w== X-Gm-Message-State: ALyK8tJVvAtEhdQOmq0dMuL96yr5Rk1Z/7EW/2MaaNmR5bw/5UzUvXjYB/CqB6nI49bAiw== X-Received: by 10.194.9.38 with SMTP id w6mr3967290wja.62.1467965789261; Fri, 08 Jul 2016 01:16:29 -0700 (PDT) Received: from localhost (nat-maths.univ-savoie.fr. [193.48.123.14]) by smtp.gmail.com with ESMTPSA id l4sm2898096wjk.18.2016.07.08.01.16.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Jul 2016 01:16:28 -0700 (PDT) Sender: Rodolphe Lepigre Date: Fri, 8 Jul 2016 10:16:27 +0200 From: Rodolphe Lepigre To: Nicolas Ojeda Bar Cc: OCaml Mailing List Message-ID: <20160708081627.GL11971@HPArchRod.localdomain> References: <20160708080134.GK11971@HPArchRod.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Subject: Re: [Caml-list] Printf.sprintf "%a" Thanks for your answer! > I don't think this is possible with Printf.  But if you can switch to Format > you can use Format.asprintf instead. Yes, I know it is possible to use Format. This is actually what I am doing currently! However, I am not using any of the formating features, so I'd like to switch to Printf to avoid going from channels to formatters all the time... >> 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 Cheers, Rodolphe -- Rodolphe Lepigre LAMA, Université Savoie Mont Blanc, FRANCE http://lama.univ-smb.fr/~lepigre/ On 08/07/2016 10:08, Nicolas Ojeda Bar wrote: