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 ACCB67EE6B for ; Sat, 30 Nov 2013 04:15:41 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.115 as permitted sender) identity=mailfrom; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; 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@www1.g3.pair.com) identity=helo; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@www1.g3.pair.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoYDAFBXmVJCJwNzY2dsb2JhbABas1mJEoE2AxgHDgg8gix5GzRpFIgGv0cXjiBoBxaEHQOYEwGVPDw X-IPAS-Result: AoYDAFBXmVJCJwNzY2dsb2JhbABas1mJEoE2AxgHDgg8gix5GzRpFIgGv0cXjiBoBxaEHQOYEwGVPDw X-IronPort-AV: E=Sophos;i="4.93,799,1378850400"; d="scan'208";a="46183755" Received: from www1.g3.pair.com ([66.39.3.115]) by mail2-smtp-roc.national.inria.fr with SMTP; 30 Nov 2013 04:15:40 +0100 Received: (qmail 97409 invoked by uid 9370); 30 Nov 2013 03:15:39 -0000 Date: 30 Nov 2013 03:15:39 -0000 Message-ID: <20131130031539.97408.qmail@www1.g3.pair.com> From: oleg@okmij.org To: 5764c029b688c1c0d24a2e97cd764f@gmail.com CC: caml-list@inria.fr, gabriel.scherer@gmail.com In-reply-to: <52985F14.4090508@gmail.com> Subject: Re: [Caml-list] [batteries] ... how to create (format) directives > > (* It is possible to avoid s" " below, so to insert interworld space > > automatically > > *) > > I do not understand what do you have in mind (above). (Sometimes > spaces are desired, sometimes they are undesired. I do not see a > general rule that could be embedded to `b' so that it could reliably > decide in either way.) > > > > > let ex4 = let open PrintComp in pr > > b"mdx" s" " it "command" br > > s"Perform a given " it "command" br > > s"Section COMMANDS describes all the supported commands." > > sprintf I think there is a rule, but it depends on the context. For example, in br b"xxx" the 'b' command should not insert the leading white space, but in s"yyy" b"xxx" it has to. It is not that difficult to implement such a context-sensitive rule since a formatting instruction like 'b' and 's' has access its the context: that's the 'st' parameter being passed around. So, a formatting command could check what has occurred before and insert a whitespace as needed. If we do mean that two strings should be typeset without an intervening space, we should define a special formatting instruction 'nosp'. I forgot to mention that the FORTH-like formatter in the previous message looks quite similar to the one used in BibTeX.