Thank you; that worked nicely! ... -- Jonathan Hayward, christos.jonathan.hayward@... An Orthodox Christian author: theology, literature, et cetera. My...
... Because "open" is just a syntactic convenience that refers to existing definitions (in this case, there are none because the functor has not been ...
Jon Harrop
jon@...
May 1, 2009 5:18 pm
11044
I was wondering how you would iterate through a given list within a function. I have the following function that sums up all the elements in the list: let...
... This would iterate n+1 times, i.e. it is an off-by-one error. And the parentheses are superfluous. ... There is no += operator in OCaml. And your "total"...
Jon Harrop
jon@...
May 1, 2009 6:05 pm
11046
... I've wondered about this and been unsure how to properly test it. Which is faster, open or include? Could you provide an example? Hez -- Hezekiah M. Carty...
I don't understand. Of course the functor application must be carried out and then there is a resulting module. That's what include must be doing. Why would it...
... Because "open" just creates aliases to existing definitions. ... I believe it affects things like inlining. ... IIRC, include can be significantly faster...
Jon Harrop
jon@...
May 1, 2009 7:24 pm
11049
... Jon mentioned that the canonical way of summing up the elements in a list is with a fold, but let's talk about manipulating lists in general. ... You're...
I am trying to dynamically create a list given a function and a size. I have done this successfully with an array but I am having problems appending an item to...
... You can do this with Array.init for arrays so the easiest solution for a list is: let list_init n f = Array.to_list(Array.init n f) -- Dr Jon Harrop,...
Jon Harrop
jon@...
May 2, 2009 12:55 am
11052
... Lists are immutable in OCaml. The constructor ``::'' takes an ELEMENT and a list and build a new list prepending the element to the old list. For...
Christophe TROESTLER
Christophe.Troestler+...
May 2, 2009 9:08 am
11053
In the http://ocaml-lib.sourceforge.net/doc/ExtList.List.html List extension of http://code.google.com/p/ocaml-extlib/ extlib there is a function init that...
citromatik
miguel.pignatelli@...
May 2, 2009 9:05 pm
11054
Hello, I'd like to produce an interactive toplevel including the bitstring library syntax ([1]). After reading the documentation, i guess i have use the...
Hi,I've tried to build ocaml-bitstring-2.0.0 from sources to study the problem, but it seems I'm stuck in the missing camlp4of.opt dependency quagmire. camlp4...
Hi, I am an absolute beginner of Ocaml (2 days!), I installed Ocaml on Windows Vista and it seems working but when I try to compile with ocamlopt I get an...
Hi, ... Please have a look to http://camlcvs.inria.fr/cgi-bin/cvsweb/ocaml/README.win32?rev=1.46 Regards, ChriS...
Christophe TROESTLER
Christophe.Troestler+...
May 10, 2009 6:30 pm
11059
Hi, I am working on algorithms for manipulation of boolean circuits (DAGs), and one of the frequent things that need to be done in this context is replacing a...
... One alternative is to abstract away the concept of a reference. For example, rather than using a low-level reference from an edge to the vertex at its end,...
Jon Harrop
jon@...
May 12, 2009 3:18 pm
11061
Thank you very much for your reply ! ... So, if a circuit is an array of gates, the circuit manipulation functions will return a new version of this array ?...
... Hash: SHA1 ... Yes. The common parts will be shared. Peng ... Version: GnuPG v2.0.7 (GNU/Linux) ...
Peng Zang
peng.zang@...
May 12, 2009 4:06 pm
11064
Le Fri, 1 May 2009 17:30:47 -0700 Robbie Plankenhorn ... let tabulateN f n = let tabaux l = function ... in tabaux [] 0;; if you want the list [(f (n-1)); (f...
Hello! I've spent the last couple of hours cruising around the web trying to figure out how to get ocamlbuild to make a toplevel. It clearly has that...
... From this page: http://brion.inria.fr/gallium/index.php/Special_files it seems that you should use a *.mltop file. Let's try. c:/mts/testtop $ cat...
Matthieu-- You have made me very happy! I didn't understand how these special files work. Here is a bit of makefile to build a toplevel with all of the modules...
Hi, I'm trying to figure out a simple program to take input on stdin and echo it back. Something like (but this isn't working). Can anyone help? let file =...
... Cancel - got it... let _ = let rec printline () = try let line = input_line stdin in print_endline line; printline () with End_of_file -> () in printline...