caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hongbo Zhang <bobzhang1988@gmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] Re: A question about Format boxes
Date: Fri, 26 Oct 2012 11:23:50 -0400	[thread overview]
Message-ID: <508AAB06.5010503@gmail.com> (raw)
In-Reply-To: <87zk4u3r42.fsf@maru.md5i.com>

Hi, I think he is trying to explain the difference:

let s = "--------------------------" in Format.fprintf 
Format.std_formatter "@[<hov1>(%s@[<hov1>(%s@[<hov1>(%s@,)@]@,)@]@,)@]" 
s s s;;
let s = "--------------------------" in Format.fprintf 
Format.std_formatter "@[<hov1>(%s@[<hov1>(%s@[<hov1>(%s@,)@]@,)@]@,)@]" 
s s s;;
(--------------------------(--------------------------(--------------------------
                                                        )))- : unit = ()
# let s = "--------------------------" in Format.fprintf 
Format.std_formatter "@[<1>(%s@[<1>(%s@[<1>(%s@,)@]@,)@]@,)@]" s s s;;
let s = "--------------------------" in Format.fprintf 
Format.std_formatter "@[<1>(%s@[<1>(%s@[<1>(%s@,)@]@,)@]@,)@]" s s s;;
(--------------------------(--------------------------(--------------------------
                                                        )
                             )
  )- : unit = ()

HTH
On 9/13/12 11:00 AM, Michael Welsh Duggan wrote:
> The example at
> <URL:http://caml.inria.fr/resources/doc/guides/format.en.html#hov-boxes>
> shows a major difference in the output of packing versus structural hov
> boxes.  However, in my experiments I cannot achieve the output this
> example assigns to "packing" boxes.  (OCaml 3.12)
>
> My examples from the REPL are below.  Would someone be able to tell me
> what I am doing incorrectly?
>
> # Format.printf "@[<hv 2>(---@\n@[<hv 2>(---@\n@[<hv 2>(---@,)@]@,)@]@,)@]@\n";;
> (---
>    (---
>      (---)))
> - : unit = ()
> # Format.printf "@[<hov 2>(---@\n@[<hov 2>(---@\n@[<hov 2>(---@,)@]@,)@]@,)@]@\n";;
> (---
>    (---
>      (---)))
> - : unit = ()
> # Format.printf "@[<2>(---@\n@[<2>(---@\n@[<2>(---@,)@]@,)@]@,)@]@\n";;
> (---
>    (---
>      (---)))
> - : unit = ()
> # Format.printf "@[<b 2>(---@\n@[<b 2>(---@\n@[<b 2>(---@,)@]@,)@]@,)@]@\n";;
> (---
>    (---
>      (---)))
> - : unit = ()
>
>


      parent reply	other threads:[~2012-10-26 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 15:00 [Caml-list] " Michael Welsh Duggan
2012-09-14 16:30 ` Martin Jambon
2012-10-26 15:23 ` Hongbo Zhang [this message]

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=508AAB06.5010503@gmail.com \
    --to=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    /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).