Hi I used camlidl to create OCaml bindings to a C library. I am using a Debian testing with OCaml 3.12.1 installed. I also have OCaml 4.00.0 installed through...
Hi Johan, I tried to compile an old library of mine using camlidl (I also use OPAM with the 4.00.1 compiler). I had to add a CCopt option in the _oasis file to...
Hello, as I am playing with data structures, I need to write my own *to_string functions. And for that I need to concatenate strings that are string...
Hi, I am trying to achieve some form of polymorphism to print my data structures (ints, floats, List of ints, List of floats or List of ADTs). Is there a way...
Complementing François's useful answer: to concatenate lots of strings together, Buffer is definitely the way to go. If you want to serialize data, printing...
Hi Jason, I'm affraid what you're looking for (ad-hoc polymorphism) doesn't exist in ocaml. You have to give your print functions different names and apply the...
Regarding serialization and stuff. First of all, I am learning. And as I've discovered, implementing something similar to Perl data structures is a good test...
Avoid camlp{4,5} at (nearly) all cost. It's tempting but too often misused in practice (been there, done that). Find a good way to have something clean in the...
Regarding "Avoid camlp{4,5} at (nearly) all cost" - well, it's my very purpose to be outside of the language. In Perl I write as I think, something like this: ...
Meh, I think jumping on Camlp{4,5} head first will result in you making bad design choices. Could you elaborate on what you would like to write, what would be...
I suggest to look at examples here: http://perldoc.perl.org/perldsc.html . Fundamentally, I am looking for a "better Perl". OCaml seems to fit the "definition"...
It looks like you're looking for either: - embedding all the values you're interested in a single big sum type (like you have in a dynamic language); you lose...
... From: Gabriel Scherer <gabriel.scherer@...> Subject: Re: "ocaml_beginners"::[] is String.concat efficient enough for "production" use ? To:...
Hello, I've checked Sys.max_string_length: " # Sys.max_string_length;; - : int = 16777211 ". By my standards it's a small value. For example, in Perl strings...
Hi Sergei, try 64 bit ocaml. The length limit is due to the data representation chosen by ocaml. ... -- -- Regards, Hongbo [Non-text portions of this message...
Even though my desktop (but not laptop) CPU is capable of running 64 bits, I still prefer 32 bit versions of Linux for various practical reasons. Could you...
13769
oliver
oliver@...
Feb 21, 2013 2:12 am
... [...] Initially OCaml was written/designed with 64 Bit systems in mind. Later, when it shows up that 32 Bit machines will stay on market for quite long...
On Wed, 20 Feb 2013 13:59:43 +0800 ... Well, not really cleanly but Batteries has some kind-of-solution, check out the "dump" function there. regards, Marek...
Hello, in Perl there is 'x' binary operator which replicates its left operand string: " sergei@amdam2:~/junk> perl -e 'print "foo" x 3, "\n"' foofoofoo ". I...
... open Printf let v = "foo" in printf "%s%s%s92;n" v v v; ... More seriously, for more string fun, you can have a look in the Str module from the stdlib, the...
Thanks. Is the batteries library compatible with standard libraries ? I.e. will some standard library functions be overridden, or the batteries do no export...
... Yes, it's even recommended to add batteries in your project library ! ... Depends, when you'r opening the batteries module, it will overide some standard...