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 F0E6A7EE25 for ; Thu, 7 Nov 2013 22:14:59 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.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@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@tot-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4CAIEBfFImacjlnGdsb2JhbABaDoMxU6w4klaBHh4OAQEBAQEGDQkJFCiCJQEBBScZAQEsCwEPCwsDCg0hIQESAQUBChIGExKHXQMPAwIIniaLDoRSAQWEfAMKiWUGjGeCPzMHhDCJQ4xhgWuBL4sjg0wYKYQSXQ X-IPAS-Result: Ah4CAIEBfFImacjlnGdsb2JhbABaDoMxU6w4klaBHh4OAQEBAQEGDQkJFCiCJQEBBScZAQEsCwEPCwsDCg0hIQESAQUBChIGExKHXQMPAwIIniaLDoRSAQWEfAMKiWUGjGeCPzMHhDCJQ4xhgWuBL4sjg0wYKYQSXQ X-IronPort-AV: E=Sophos;i="4.93,654,1378850400"; d="scan'208";a="34297457" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Nov 2013 22:14:58 +0100 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1VeWum-0007lG-Dv for caml-list@inria.fr; Thu, 07 Nov 2013 16:14:56 -0500 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VeWum-0006Hm-Cy for caml-list@inria.fr; Thu, 07 Nov 2013 16:14:56 -0500 Received: from mail-ee0-f50.google.com ([74.125.83.50]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1VeWum-0007DN-5z for caml-list@inria.fr; Thu, 07 Nov 2013 16:14:56 -0500 Received: by mail-ee0-f50.google.com with SMTP id b45so595240eek.9 for ; Thu, 07 Nov 2013 13:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=emU2CYasSiif1JMtD5euYjJDpvCiaqBFIGUizu1i4W4=; b=pHFRj7R7avzXXVsoijSZfwiaXkdacv0TgOvEUEI3LMfGzkukQhi75UaZuTYRqkpInY /iWIfhpHdDd9Z8g9M3dATJVxiiGUiGzWehIScEuJJxElAxAqp5+kmjV2/SPHlT+bj5rx KqS1QbqTiuJGvLm9/IVx3VIQHlxxtszocYe58= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=emU2CYasSiif1JMtD5euYjJDpvCiaqBFIGUizu1i4W4=; b=M2r+xx+zorB762Hf0kEqEUPMOTnhxaGLBfOEDLXv/eOjWTweSQQTnwyGr5nfCydqBl bVaMd5SL21zo3LiitCs4VBNaUSDtnycsZg295ZOTHHMYe+K/5AYmvGt9NYN8D+vXyQzP K08EtKVaO7Ylo1UYWyViqGwvQUAJ9CB+fGpkFkqOqvhCKFVe7q9U8QBGPxp8zFOlTcac RmyH7L6dY+BVzwxdna2s38BoFYmCQQk8+l4vbD4747wSnR7ebCAJhKMXy+pto8A8qHej RYM63HCSn0sC5kh44gfegFyWjcC0muDwlgwm/xNySV0d2WOynmRrnk11h7d+bH+a+CXZ WwVw== X-Gm-Message-State: ALoCoQnVhWg+Rwk0av9hH4mLZ1NKVkYlAdDQ8X29YLSFrwge9H9fMb3/nbTaPHr62tZHHzTtjUUHVeBupGUv1wBlFNOLLfmOVOEChwgXFNCT0wSgANbTZUj+K4qiM7rIIQMeC/cxJuWYh1SMrlmKJV55erbbpdKJWw== X-Received: by 10.15.73.130 with SMTP id h2mr11654390eey.56.1383858895659; Thu, 07 Nov 2013 13:14:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.15.73.130 with SMTP id h2mr11654375eey.56.1383858895534; Thu, 07 Nov 2013 13:14:55 -0800 (PST) Received: by 10.223.180.138 with HTTP; Thu, 7 Nov 2013 13:14:55 -0800 (PST) In-Reply-To: <24B5DA6D-3203-4F62-BB58-99ED8B1C64EF@my.bristol.ac.uk> References: <1383742480351@names.co.uk> <24B5DA6D-3203-4F62-BB58-99ED8B1C64EF@my.bristol.ac.uk> Date: Thu, 7 Nov 2013 16:14:55 -0500 Message-ID: From: Yaron Minsky To: Ollie Frolovs Cc: David MENTRE , Gabriel Scherer , Mark Adams , caml users Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] is there a way for turning strings to "format"s? It should work for both. On Thu, Nov 7, 2013 at 3:45 PM, Ollie Frolovs wr= ote: > When i first saw this question i had a deja vu moment and as was flicking= through =93Real World Ocaml=94 today i found this example in pages 173-174: > > #let fmt =3D : (=91a, =91b, =91c) format =3D =93%i is an integer, %F is a= float, \=94%s\=94 is a string\n=94;; > val fmt =3D (int -> float -> string -> =91c, =91b, =91c) format =3D > > and then they say you can pass this format string to printf. I don=92t kn= ow if they mean Jane Street=92s Core printf or stock printf. I=92m only a b= eginner myself. > > =97 Ollie > > On 7 Nov 2013, at 07:50, David MENTRE wrote: > >> Hello, >> >> 2013/11/7 Gabriel Scherer : >>> Do not, ever, use Obj.magic on formatting >>> functions. >> >> I would say: "Dot not, ever, use Obj.magic (FULL STOP)". ;-) >> >> BTW, isn't "ksprintf " and related functions used when one wants to >> play with format strings? >> >> Best regards, >> david >> >> -- >> 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 > > > -- > 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