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

13605Re: "ocaml_beginners"::[] [OASIS help] packed library, separate interface

Expand Messages
  • Philippe Veber
    Sep 4, 2012
    • 0 Attachment
      I suggested to remove the Pack option so that you could declare Mylib in
      "Modules" and create a mylib.ml file that would contain:

      module A = A
      module B = B
      etc ...

      That way you get 1 and 2, at the expense of packing modules manually. This
      may seem unsatisfying at first glance but this is not as bad as it seems
      (core and batteries have that kind of module for instance). I don't think
      you can declare Foo as a module if foo.ml (or foo.mly) is not present. I
      would have thought it would fail, but at least it does not work as you'd
      expect and I'm not sure you could force it to. Maybe somebody on the oasis
      mailing will have a clue?

      ph.

      2012/9/4 "Markus W. Weißmann" <markus.weissmann@...>

      > Hi Philipp,
      >
      > I solved problem 1.) by replacing "Modules" with "InternalModules"; as I
      > only have submodules and no "mylib.ml", "Pack: true" seems to be the way
      > to go.
      > The missing piece now is 2.), that my "mylib.mli" interface file is not
      > getting installed.
      >
      >
      > -Markus
      >
      > On 4 Sep 2012, at 19:58, Philippe Veber wrote:
      >
      > > Hi Markus,
      > >
      > > If I'm not mistaken I had a similar problem with ocaml-r, here is its
      > > _oasis file:
      > >
      > > https://github.com/pveber/OCaml-R/blob/master/_oasis
      > >
      > > The trick was not based on Pack but on the InternalModules option. I hope
      > > this may help you, let me know if you have questions.
      > >
      > > Philippe.
      > >
      > >
      > >
      > > PS Note that this _oasis file will not work with oasis 0.3 because of the
      > > new Object section. But this is not related to your problem I think.
      > >
      > > 2012/9/4 Markus Weissmann <markus.weissmann@...>
      > >
      > >> Hi Sylvain and everyone,
      > >>
      > >> I'm trying to switch my library over to Oasis and have a few problems.
      > >> My library consists of several modules that get packed into a single
      > >> module for which exists a "global" mli file.
      > >>
      > >> So its something like: src/mylib.mli, src/a.ml, src/b.ml, src/c.ml
      > >>
      > >> 1.) I found the Pacl option in the source code (still missing from the
      > >> docs); and wrote this:
      > >>
      > >> ------
      > >> OASISFormat: 0.3
      > >> Name: mylib
      > >> Version: 0.1
      > >> Synopsis: do stuff
      > >> Authors: Markus Weissmann
      > >> License: BSD3
      > >> Plugins: META (0.3)
      > >>
      > >> Library mylib
      > >> Pack: true
      > >> Path: src
      > >> BuildTools: ocamlbuild
      > >> Modules: A, B, C
      > >> -------
      > >>
      > >> This works, but _also_ installs all modules separately to the system
      > along
      > >> with META, mylib.a, etc. I get a.ml, a.cmi etc. -- is this a bug or a
      > >> feature?
      > >>
      > >> 2.) How do I make oasis install my "global" interface 'mylib.mli'?
      > >>
      > >>
      > >> Thanks & regards
      > >>
      > >> -Markus
      > >>
      > >> --
      > >> Markus Weißmann, M.Sc.
      > >> Technische Universität München
      > >> Institut für Informatik
      > >> Boltzmannstr. 3
      > >> D-85748 Garching
      > >> Germany
      > >> http://wwwknoll.in.tum.de/
      > >>
      > >>
      > >>
      > >> ------------------------------------
      > >>
      > >> Archives up to December 31, 2011 are also downloadable at
      > >> http://www.connettivo.net/cntprojects/ocaml_beginners
      > >> The archives of the very official ocaml list (the seniors' one) can be
      > >> found at http://caml.inria.fr
      > >> Attachments are banned and you're asked to be polite, avoid flames
      > >> etc.Yahoo! Groups Links
      > >>
      > >>
      > >>
      > >>
      > >
      > >
      > > [Non-text portions of this message have been removed]
      > >
      >
      > --
      > Markus Weißmann, M.Sc.
      > Technische Universität München
      > Institut für Informatik
      > Boltzmannstr. 3
      > D-85748 Garching
      > Germany
      > http://wwwknoll.in.tum.de/
      >
      >
      >
      > ------------------------------------
      >
      > Archives up to December 31, 2011 are also downloadable at
      > http://www.connettivo.net/cntprojects/ocaml_beginners
      > The archives of the very official ocaml list (the seniors' one) can be
      > found at http://caml.inria.fr
      > Attachments are banned and you're asked to be polite, avoid flames
      > etc.Yahoo! Groups Links
      >
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Show all 4 messages in this topic