caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: oleg@okmij.org
To: 5764c029b688c1c0d24a2e97cd764f@gmail.com
Cc: caml-list@inria.fr, gabriel.scherer@gmail.com
Subject: Re: [Caml-list] [batteries] ... how to create (format) directives
Date: 30 Nov 2013 03:15:39 -0000	[thread overview]
Message-ID: <20131130031539.97408.qmail@www1.g3.pair.com> (raw)
In-Reply-To: <52985F14.4090508@gmail.com>


> > (* 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. 


  reply	other threads:[~2013-11-30  3:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 15:46 [Caml-list] [batteries] ... how to create (format) directives that do not take any arguments? Matej Kosik
2013-11-25 16:27 ` Gabriel Scherer
2013-11-27 11:37   ` Matej Kosik
2013-11-28  6:30     ` [Caml-list] [batteries] ... how to create (format) directives oleg
2013-11-29  9:32       ` Matej Kosik
2013-11-30  3:15         ` oleg [this message]
2013-11-27 11:54 ` [Caml-list] [batteries] ... how to create (format) directives that do not take any arguments? Jeremie Dimino
2013-11-27 12:52   ` Matej Kosik
2013-11-27 13:00     ` Jeremie Dimino
2013-11-29  9:32       ` Matej Kosik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131130031539.97408.qmail@www1.g3.pair.com \
    --to=oleg@okmij.org \
    --cc=5764c029b688c1c0d24a2e97cd764f@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).