<pmatos>
Does anyone know how to access ocaml objects from C? After reading 18.7 of the manual, that doesn't seem very clear.
<pmatos>
Although the fib example is nice it seems somewhat straightforward since it deals which integers but what happens with more complex types, strings, structures, etc?
Aradorn has joined #ocaml
pmatos has quit [Remote closed the connection]
jlouis has joined #ocaml
<flux->
I don't know about that, but I'm thinking it should be the same as the usual interfacing with ocaml with C (with just plain records)
<flux->
but, he left already..
<flux->
(doesn't teach me to not ignore joinspartsquits, though)
Smergo has quit [Remote closed the connection]
Smergo has joined #ocaml
bohanlon has quit [Read error: 145 (Connection timed out)]
velco has quit ["<boris``> reduction ad absurdum is a fallacious method of proof"]
<lmbdwr>
if anyone has 30 sec to tell me where is my mistake ..
<flux->
you're not defining module Indices to be the struct .. end -stuff
<flux->
that ends up as a parameter to Map.Make
<lmbdwr>
well, I do module Indices = Map.Make(...)
<flux->
you could write something like..
<flux->
module IndexMap = Map.Make( ..stuff without size or incsz.. )
<lmbdwr>
I want size and incsz
<lmbdwr>
:)
<flux->
and then module Indices = struct include IndexMap let size = .. let incsz = .. end
<lmbdwr>
ah ok.
<lmbdwr>
I have to do that
<flux->
then you have module Indices which is like your old Indices but with some extra functions
<lmbdwr>
that was my next try but you saved my time
<lmbdwr>
somehow
<flux->
for that code I would propably use that module IndexMap and then write module Indices without including module IndexMap
<flux->
that is, in terms of IndexMap
<flux->
forwarding something like find could simply be written as let find = IndexMap.find
<flux->
actually, not quite
<flux->
because if you want to have multiple Indices-instantiations, you want to keep separate data structures for them too - in your case you are always sharing the size-variable
<flux->
which I doubt is what you want
<flux->
infact it seems you should have indices.mli (with the public interface) and indices.ml (with the private implementation).. again being implemented in the terms of IndexMap, which can be privately defined
Submarine has joined #ocaml
Harzilein has left #ocaml []
_shawn_ has joined #ocaml
<lmbdwr>
flux-, actually I dont want to share this object with anyone, so yes, I want a single variable for this submodule.
<lmbdwr>
there is only one submodule Indices in the whole program
brainly-green has quit [Success]
pangoafk is now known as pango
bohanlon has joined #ocaml
<pango>
lmbdwr: functors are like functions... properties of a function's domain do not magically propagate to its codomain...
bluestorm has joined #ocaml
mrpingoo has joined #ocaml
<fremo>
I have four modules with inter-dependences, who to pack it into one lib ?
<fremo>
I use OCamlMakefile and ocamlfind and I am totaly lost with all that
<fremo>
I found no example nor easy documentation on this
bohanlon has quit [Read error: 60 (Operation timed out)]
<fremo>
I tried to pack modules A B C D in lib to do lib.cma but it asked for lib.mli and then fall in cross-dep for lib.cmi cause it wanted to build lib.cmo
<fremo>
but I have no lib.ml, I just fill lib.mli with modules signatures of A B C and D
<mrpingoo>
fremo: if there are inter-dependencies, whether your building a lib or not, it's a problem you won't be able to work around
<mrpingoo>
the typical solution to mutual dependencies is to break down one module into several
<fremo>
ho, right
<fremo>
not interdep
<fremo>
but A depends on B and B on C for example
<fremo>
I can build the lib by hand
<mrpingoo>
ok
<mrpingoo>
you just want to know how to explain that to the OCamlMakefile ?
<fremo>
you see, It's more just a build problem :)
<mrpingoo>
I'm not good at OCamlMakefile, but let's see...
<fremo>
exactly
<mrpingoo>
what SOURCES did you define ?
<mrpingoo>
there should be all your .ml and .mli in dependency order
<fremo>
SOURCES is A.ml B.ml C.ml D.ml
<fremo>
that's write
bohanlon has joined #ocaml
<mrpingoo>
what's the exact error you get ?
<fremo>
I can build it and when I build another program depending on this lib with -I ../lib/, its ok
<fremo>
I had a lot of different errors,
<fremo>
I had a good one
<fremo>
2 sec
<mrpingoo>
-I ../lib works, good. when does it stop working? you just miss the install, it seems
<mrpingoo>
you should install all .mli .cmi and cm[x]a
<fremo>
ok, but, I should build one library per module ? (cma, but I just got cmo's)
<fremo>
I tried to build one lib with the four modules in, is it wrong way ?
pango_ has joined #ocaml
<mrpingoo>
no, there should be only one .cma
<mrpingoo>
and one cmxa
<mrpingoo>
(I'm actually taking the example of ocaml-vorbis, of which I'm not the author)