RE: [Caml-list] Ampersand in camlp4 grammar extension

2009-01-28 Thread Paul Steckler
Hi Nicolas, > However I can guess in your question that you don't really want to change the syntax of the binary operator "&", but rather to change it's meaning. In camlp4 there is a much more sane and easier way to do this using filters. By the way there is an example in the camlp4 sources that d

[Caml-list] Re: Portable Ocaml multiprocessing?

2009-01-28 Thread Zheng Li
On 1/28/2009 11:35 PM, Sylvain Le Gall wrote: On 28-01-2009, Dmitry Bely wrote: There are numerous environments/libraries that support process-based Ocaml multiprocessing: jocaml, OCamlP3l, OcamlMPI (and probably others). Do I get it right that all of them are Unix-only? jocaml and ocamlp3l

Re: [Caml-list] Portable Ocaml multiprocessing?

2009-01-28 Thread Andres Varon
On Jan 28, 2009, at 1:22 PM, Dmitry Bely wrote: There are numerous environments/libraries that support process-based Ocaml multiprocessing: jocaml, OCamlP3l, OcamlMPI (and probably others). Do I get it right that all of them are Unix-only? I have used mpich2 in windows: http://www.mcs.anl.go

Re: [Caml-list] Re: Portable Ocaml multiprocessing?

2009-01-28 Thread Andres Varon
On Jan 28, 2009, at 5:35 PM, Sylvain Le Gall wrote: On 28-01-2009, Dmitry Bely wrote: There are numerous environments/libraries that support process-based Ocaml multiprocessing: jocaml, OCamlP3l, OcamlMPI (and probably others). Do I get it right that all of them are Unix-only? jocaml and o

[Caml-list] Re: Portable Ocaml multiprocessing?

2009-01-28 Thread Sylvain Le Gall
On 28-01-2009, Dmitry Bely wrote: > There are numerous environments/libraries that support process-based > Ocaml multiprocessing: jocaml, OCamlP3l, OcamlMPI (and probably > others). Do I get it right that all of them are Unix-only? > jocaml and ocamlp3l seems indeed unix only. I think however tha

Re: [Caml-list] Defining a family of functors

2009-01-28 Thread David Teller
On Wed, 2009-01-28 at 01:32 +0100, Nicolas Pouillard wrote: > The encoding of modules using existential types in non modular, this > basically means that you have to heavily transform the source. > > What one need to encode modules is "open" existential types, this well > and clearly explained in

Re: Re : [Caml-list] Warning wished

2009-01-28 Thread Nicolas Pouillard
Excerpts from Julien SIGNOLES's message of Wed Jan 28 15:24:14 +0100 2009: > Le mercredi 28 janvier 2009 à 14:07 +, Matthieu Wipliez a écrit : > > > Hello, > > > > > > Is it a bug or a well-known feature that the above program does not emit > > > a warning (because "f x" should have type unit

Re: [Caml-list] Ampersand in camlp4 grammar extension

2009-01-28 Thread Nicolas Pouillard
Excerpts from Paul Steckler's message of Wed Jan 28 10:39:16 +0100 2009: > I'm writing a camlp4 grammar extension for OCaml that tries to match > ampersands and rewrite expressions containing them. That wouldn't > be a good idea if my code contained ordinary ampersands used for conjunctions. > But

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Markus Mottl
On Wed, Jan 28, 2009 at 2:05 PM, Stéphane Glondu wrote: > Oh... I overlooked this one. You have to manage to get a set of .a files > so that each object (.o) is there only once. In this case, I would drop > libblas.a, since it is a dependency of liblapack (AFAIU). Another thing you could do is to

Re: [Caml-list] Warning wished

2009-01-28 Thread Dmitri Boulytchev
There's the question of what the compiler _does_, what the compiler _could_ do and what the compiler _should_ do. The latter is mainly a matter of taste :) I don't think "this 'a could be unit" is a good reason for skipping the warning. On the contrary, "this 'a will probably sometimes b

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Stéphane Glondu
Erick Matsen a écrit : > Hm, unfortunately not the first one. > >>> /usr/lib/libblas.a(xerbla.o): In function `xerbla_': >>> (.text+0x0): multiple definition of `xerbla_' >>> /usr/lib/liblapack.a(xerbla.o):(.text+0x0): first defined here > > It doesn't link... Oh... I overlooked this one. You ha

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Erick Matsen
Hm, unfortunately not the first one. >> /usr/lib/libblas.a(xerbla.o): In function `xerbla_': >> (.text+0x0): multiple definition of `xerbla_' >> /usr/lib/liblapack.a(xerbla.o):(.text+0x0): first defined here It doesn't link... Thanks, Erick On Wed, Jan 28, 2009 at 10:49 AM, Stéphane Glondu

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Stéphane Glondu
Erick Matsen a écrit : > [...] > /usr/lib/libblas.a(xerbla.o): In function `xerbla_': > (.text+0x0): multiple definition of `xerbla_' > /usr/lib/liblapack.a(xerbla.o):(.text+0x0): first defined here > /usr/lib/ocaml/3.10.2/libasmrun.a(unix.o): In function `caml_dlopen': > (.text+0x223): warning: Us

Re: [Caml-list] Warning wished

2009-01-28 Thread Frédéric van der Plancke
Dmitri Boulytchev wrote: Applying g to 1 you will definitely have f x of type int and you have to take care of the returned integer. Unfortunatly caml emits no warning in this case (even if I understand why) :(. Sure :) But as far as I understand this warning means "this non-unit value w

[Caml-list] Portable Ocaml multiprocessing?

2009-01-28 Thread Dmitry Bely
There are numerous environments/libraries that support process-based Ocaml multiprocessing: jocaml, OCamlP3l, OcamlMPI (and probably others). Do I get it right that all of them are Unix-only? - Dmitry Bely ___ Caml-list mailing list. Subscription manage

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Erick Matsen
Hello Mauricio--- Is this what you mean? ocamlopt \ -I /home/matsen/ocaml/bio/ -I /home/matsen/ocaml/common/ -I /usr/lib/ocaml/3.10.2/pcre/ -I /usr/lib/ocaml/3.10.2/glpk/ -I /usr/lib/ocaml/3.10.2/gsl/ -I /usr/lib/ocaml/3.10.2/lacaml/ -I /usr/lib/gcc/i486-linux-gnu/4.3/ \ -ccopt -static

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Mauricio Fernandez
On Wed, Jan 28, 2009 at 09:17:56AM -0800, Erick Matsen wrote: > Here is my compile line > > ocamlopt \ > > # source directories: > -I /home/matsen/ocaml/bio/ -I /home/matsen/ocaml/common/ -I > /usr/lib/ocaml/3.10.2/pcre/ -I /usr/lib/ocaml/3.10.2/glpk/ -I > /usr/lib/ocaml/3.10.2/gsl/ -I /usr/

Re: [Caml-list] problem with LACAML and static linking

2009-01-28 Thread Erick Matsen
Hello Stephane (and the rest of the ocaml community)--- Thank you for your input here. I do have libgfortran.a, but I might note that it's in /usr/lib/gcc/i486-linux-gnu/4.3/ rather than /usr/lib. This is in contrast to liblapack.a, etc, which just live in /usr/lib. This makes me wonder if this

Re: [Caml-list] Warning wished

2009-01-28 Thread Martin Jambon
Julien SIGNOLES wrote: > Hello, > > Is it a bug or a well-known feature that the above program does not emit > a warning (because "f x" should have type unit in the body of "g") ? > > = > let f x = x > let g x = f x; 1 > (* let _ = g 2 *) > The compiler could have a command-line switch

Re: [Caml-list] Warning wished

2009-01-28 Thread Dmitri Boulytchev
Applying g to 1 you will definitely have f x of type int and you have to take care of the returned integer. Unfortunatly caml emits no warning in this case (even if I understand why) :(. Sure :) But as far as I understand this warning means "this non-unit value will definitely be omitted,

Re: [Caml-list] Warning wished

2009-01-28 Thread Julien SIGNOLES
Hello Dmitri, > no warning should be issued in this case since you have polymorphic > function: > applying g to () you will definitely have f x of type unit :) Applying g to 1 you will definitely have f x of type int and you have to take care of the returned integer. Unfortunatly caml emits

Re: Re : [Caml-list] Warning wished

2009-01-28 Thread Julien SIGNOLES
Le mercredi 28 janvier 2009 à 14:07 +, Matthieu Wipliez a écrit : > > Hello, > > > > Is it a bug or a well-known feature that the above program does not emit > > a warning (because "f x" should have type unit in the body of "g") ? > > > > = > > let f x = x > > let g x = f x; 1 > > (* let

Re: [Caml-list] Warning wished

2009-01-28 Thread Dmitri Boulytchev
Hello Julien, no warning should be issued in this case since you have polymorphic function: applying g to () you will definitely have f x of type unit :) Try another one: let f x = x+1 let g x = f x; 1 Now you'll get the warning since the compiler can ensure that type of f

Re : [Caml-list] Warning wished

2009-01-28 Thread Matthieu Wipliez
> Hello, > > Is it a bug or a well-known feature that the above program does not emit > a warning (because "f x" should have type unit in the body of "g") ? > > = > let f x = x > let g x = f x; 1 > (* let _ = g 2 *) > I'm not familiar with the internals of the compiler, but what I suppo

[Caml-list] Warning wished

2009-01-28 Thread Julien SIGNOLES
Hello, Is it a bug or a well-known feature that the above program does not emit a warning (because "f x" should have type unit in the body of "g") ? = let f x = x let g x = f x; 1 (* let _ = g 2 *) Best regards, Julien Signoles ___ Caml-list

[Caml-list] Ampersand in camlp4 grammar extension

2009-01-28 Thread Paul Steckler
I'm writing a camlp4 grammar extension for OCaml that tries to match ampersands and rewrite expressions containing them. That wouldn't be a good idea if my code contained ordinary ampersands used for conjunctions. But the code doesn't. I'm struggling how to match the ampersands in my expression r