Loading ...
Sorry, an error occurred while loading the content.

prettyprinting

Expand Messages
  • philippe_sismondi
    How can I prettyprint values as the toplevel does it? (I mean by calling a library function.) Is there a quick-and-dirty way to do this? I have been developing
    Message 1 of 3 , May 1, 2011
    • 0 Attachment
      How can I prettyprint values as the toplevel does it? (I mean by calling a library function.) Is there a quick-and-dirty way to do this?

      I have been developing my compiler project interactively using the emacs and the REPL. It suddenly hit me today that I will very soon need to prettyprint ASTs etc. from within a standalone program.

      In the end I will RTFM of course - it appears this stuff is in the Format module. Is that right?

      Best,

      - Phil -
    • Cedric Cellier
      ... There is a lib with the toploop functions, such as a function to pretty print a value (toplevellib.cma).
      Message 2 of 3 , May 1, 2011
      • 0 Attachment
        ----- Message d'origine -----
        > How can I prettyprint values as the toplevel does it? (I mean by calling
        > a library function.) Is there a quick-and-dirty way to do this?

        There is a lib with the toploop functions, such as a function to pretty print a value (toplevellib.cma).
      • Philippe Sismondi
        ... I take it that toplevellib is undocumented. I am looking for something like Haskell s show or Common Lisp s print. I was hoping to find something similar
        Message 3 of 3 , May 1, 2011
        • 0 Attachment
          --- In ocaml_beginners@yahoogroups.com, Cedric Cellier <rixed@...> wrote:
          >
          >
          > ----- Message d'origine -----
          > > How can I prettyprint values as the toplevel does it? (I mean by calling
          > > a library function.) Is there a quick-and-dirty way to do this?
          >
          > There is a lib with the toploop functions, such as a function to pretty print a value (toplevellib.cma).
          >

          I take it that toplevellib is undocumented.

          I am looking for something like Haskell's show or Common Lisp's print. I was hoping to find something similar in ocaml that is (a) documented, and (b) immediately usable.

          Thanks.

          - Phil -
        Your message has been successfully submitted and would be delivered to recipients shortly.