> Module.("foo" (op) "bar")
This is a local open (a more explicit notation is "let open Module in
foo op bar"). I think this is a fine solution: I don't like open, but
local mitigates its flaws.
Another solution is to rebind your operator locally:
let (op) = Module.blah in
"foo" op "bar"
(o
Haoyang Wang provided the answer you're looking for, I think!
In case you are writing your own modules with infix operators, I've found
the following style to be useful:
--- Inside Vector.ml ---
(* definition of some basic functions here... *)
(* now some infix defs using the basic functions, in
On Apr 26, 2012, at 3:36 PM, ocamllist.robertw...@spamgourmet.com wrote:
> I'm a OCaml newbie. I don't understand how to use infix functions that are
> in modules when I don't want to use "open".
>
> I did discover http://xahlee.org/ocaml/functions.html which explains that an
> infix operator
I'm a OCaml newbie. I don't understand how to use infix functions that are
in modules when I don't want to use "open".
I did discover http://xahlee.org/ocaml/functions.html which explains that
an infix operator can be used as a prefix. So, this format:
((Module.(op)) "foo" "bar")
does seem t
Le 26/04/12 14:23, Alain Frisch a écrit :
On 04/26/2012 12:08 PM, Xavier ALLAMIGEON wrote:
What do you mean exactly? I imagine that test.o needs some functions of
the libhello_world.a. But I don't see why libasmrun would need some
other functions of libhello_world...
Well, this is the case. li
On 04/26/2012 12:08 PM, Xavier ALLAMIGEON wrote:
What do you mean exactly? I imagine that test.o needs some functions of
the libhello_world.a. But I don't see why libasmrun would need some
other functions of libhello_world...
Well, this is the case. libasmrun contains the runtime system for OCa
Dear Edwin,
Le 26/04/12 10:33, Török Edwin a écrit :
Here's the way I'm compiling everything. It builds a libhello_world.a static
library from ml_code.obj.o and c_code.o.
ocamlc -c ml_code.mli
ocamlopt -c ml_code.ml
ocamlopt -output-obj ml_code.cmx -o ml_code.obj.o
gcc -c c_code.c -I"`ocamlc -w
On 04/26/2012 10:58 AM, Xavier ALLAMIGEON wrote:
> Dear caml-list,
>
> I'd like to build a static C library implementing an interface to an OCaml
> library, but I get some compilation errors. Here's an example of the problem.
>
> 1) The ml_code.* files contain a hello_world function which I'd li
Dear caml-list,
I'd like to build a static C library implementing an interface to an
OCaml library, but I get some compilation errors. Here's an example of
the problem.
1) The ml_code.* files contain a hello_world function which I'd like to
provide in C.
let ml_hello_world () =
print_en
(This message is for a French summer school, thus it is only in French.)
Bonjour à tous,
L'École Jeunes Chercheurs en Programmation se déroulera cette année du 15 juin
au 23 juin à Dinard et à Rennes, conjointement aux journées GDR – GPL et à la
conférence CIEL. Pour toute information sur le pr
10 matches
Mail list logo