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

easy reading of data structures?

Expand Messages
  • Wheeler Ruml
    I m coming to OCaml from Lisp, and although I appreciate the static typing, there are two features I really miss so far. One is macros, and I should clearly
    Message 1 of 3 , Apr 28, 2003
    • 0 Attachment
      I'm coming to OCaml from Lisp, and although I appreciate the static
      typing, there are two features I really miss so far. One is macros,
      and I should clearly investigate camlp4 more thoroughly.

      The other is easy I/O of data structures: a way to convert a
      human-readable representation into an internal data structure and
      vice-versa. The toplevel lets me enter and print a structure as a
      literal, and I'd like the same feature in my programs. Marhsalling
      seems to provide this for binary data only. Lisp's READ and PRINT
      give an instant file format, which is great for prototyping.
      Currently I must laboriously write a parser and printer for each
      important data type I write. What is the nearest equivalent in OCaml?
      (I don't think I want XML formatting, as I recall some OCaml package
      providing, since it is so verbose.)

      Thanks,

      Wheeler
      --
      Wheeler Ruml, Palo Alto Research Center, Rm 1522, 650-812-4329 voice
      ruml@..., http://www.parc.com/ruml 650-812-4334 fax
    • Eray Ozkural
      ... Lookie! Somebody else wants read/show like functions a la Haskell! The elves in the misty mountains tell me that it s possible to do that writing some
      Message 2 of 3 , Apr 28, 2003
      • 0 Attachment
        On Monday 28 April 2003 21:58, Wheeler Ruml wrote:
        > The other is easy I/O of data structures: a way to convert a
        > human-readable representation into an internal data structure and
        > vice-versa. The toplevel lets me enter and print a structure as a
        > literal, and I'd like the same feature in my programs. Marhsalling
        > seems to provide this for binary data only. Lisp's READ and PRINT
        > give an instant file format, which is great for prototyping.
        > Currently I must laboriously write a parser and printer for each
        > important data type I write. What is the nearest equivalent in OCaml?
        > (I don't think I want XML formatting, as I recall some OCaml package
        > providing, since it is so verbose.)


        Lookie! Somebody else wants read/show like functions a la Haskell!

        The elves in the misty mountains tell me that it's possible to do that writing
        some fancy p4 code, but it would be hard to write a library for this purpose,
        owing to the lack of overloading in ocaml (dammit!)

        Cheers,

        --
        Eray Ozkural (exa) <erayo@...>
        Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org
        www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza
        GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C
      • Nicolas Cannasse
        ... writing ... purpose, ... There is something for camlp4 called IOXml that can do some printing of caml types as XML documents. But I have been thinking for
        Message 3 of 3 , Apr 29, 2003
        • 0 Attachment
          > > The other is easy I/O of data structures: a way to convert a
          > > human-readable representation into an internal data structure and
          > > vice-versa. The toplevel lets me enter and print a structure as a
          > > literal, and I'd like the same feature in my programs. Marhsalling
          > > seems to provide this for binary data only. Lisp's READ and PRINT
          > > give an instant file format, which is great for prototyping.
          > > Currently I must laboriously write a parser and printer for each
          > > important data type I write. What is the nearest equivalent in OCaml?
          > > (I don't think I want XML formatting, as I recall some OCaml package
          > > providing, since it is so verbose.)
          >
          >
          > Lookie! Somebody else wants read/show like functions a la Haskell!
          >
          > The elves in the misty mountains tell me that it's possible to do that
          writing
          > some fancy p4 code, but it would be hard to write a library for this
          purpose,
          > owing to the lack of overloading in ocaml (dammit!)

          There is something for camlp4 called IOXml that can do some printing of caml
          types as XML documents. But I have been thinking for few weeks now about
          writing such a library in pure OCaml, that will use informations contained
          in a CMI file, with additionnal features such as "remote" printing thru
          sockets to enable remote or local real-time debugging. Still need to think
          about it some time...

          Nicolas Cannasse
        Your message has been successfully submitted and would be delivered to recipients shortly.