It's amazing how fast OCaml deals with factorial computations up to 170 using Float type. Since the result is like 7.25741561531e+306, I would like to see it...
... You do realize that performing 170 multiplications using normal floating point numbers shouldn't take a whole lot of time, regardless of what language is...
... OK... this is a good example of where floating point computation might let you down -- it's not exact. Consider your example above, computing 170! using...
... One other thing to note here. If you are satisfied with an approximate answer, such as the one computed by the float factorial, you may also be happy with...
Hello, I would like to know witch is the best documentation generator for OCaml so that in the end I can have something looked alike the C programing ...
... Well, I have no idea what you mean by teh C programming documentation, but the two documentation generators I use are ocamldoc and ocamlweb. OCamldoc is...
module MultiSet = Map.Make(struct type t = char let compare = compare end) let add letter bag = try let n = MultiSet.find letter bag in MultiSet.add letter...
... What's causing it is that the semicolon expects the expression in front of it to have type unit. That is, a; b us sort of like let () = a in b, only the...
... Just to make sure I've understood the issue, is the right way to look at it that MultiSet.find produced an int, so something had to consume the int, even...
... <snip> Thanks for the explanation. This one seems like the nicest option ... though ignore probably makes the intention more explicit. Is calling something...
... Depends on who you ask. I agree that they tend to be overused, and something like the option types of version 4 are better. Why? There are a few...
... I don't think it's necessarily bad style. But if I were going to choose between the options he gave, I would have to say that... let remove_blank bag = try...
... Nice, thanks! I also got it to compile using OCamlMakefile - here's the Makefile I used: OCAMLMAKEFILE = OCamlMakefile RESULT = ledit SOURCES = cursor.mli...
Hi ! I've 2 questions about this module : * I have no idea about any possible use of Hashtbl.fold... * Iterating through the table by key ? Hashtabl.iter doc...
... Hashtbl itself is a little bit strange because of the single key / multiple value thing. It was originally designed to store the symbol tables inside the...
this is in revised syntax: open Tk; value root = opentk (); value entry = Entry.create root; bind ~events:[`KeyPress] ~action:(fun event -> Printf.fprintf...
... Hash: SHA1 Hi, I am seeing some unintuitive behavior that I can't understand. I have a simple module type signature: module type Mytest = sig val id : int...
Peng Zang
peng.zang@...
Apr 6, 2007 3:10 pm
7492
This is a bit confusing, but module signatures and function signatures are different beasts. A module signature is its interface... the module signature...
... Hash: SHA1 Ahh.. of course, your explanation makes perfect sense. A module signature defines an interface and is used for restricting. It cannot...
Peng Zang
peng.zang@...
Apr 6, 2007 6:11 pm
7494
Hi Rich ! Thank you for your precious answer. ... Ah, this solves my two questions ! It is useful to build a list from the table. I will hack your Counter.read...
... Hash tables are faster and smaller than maps in OCaml. Hash tables provide a default structural hash function which, when it works (when structural ...
... In addition to Jon's answer: Map requires use of the functor syntax. This can be quite obscure -- I know that I usually have to look up the syntax when I...
... Also, since Map requires the type of keys to be given at module construction time, it's not possible to do certain things with Map like write a function...
Thanks Jon for the explanations about differences between Map and Hashtbl. I wonder how it is possible to discover these properties because I do not saw such a...
... Read my book. :-) While you're there, please add it to the list of books on Wikipedia's OCaml page! -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml...