When I read a program written by someone else I find that seeing the inferred types helps. So I use "ocamlc -i". But this does not show the types of locally...
... You can use the -dtypes compiler flag, though its output isn't very easy to read. It would be nicer if it displayed the results in terms of type ...
... (similar to Issac's way, but ...heuristically :-)) ) It happens to me to put a checkpoint by casting a item to a type, and watch for complaints. # let fact...
... Thanks. It really does look ugly. And I don't know emacs :( (the manual says that it can be parsed by a set of emacs macros that come with the OCaml...
... Hello, you might be interested by the -dtypes option of ocamlc: it generates a file.annot file with "detailed type informations" - as says the manual. ...
I'm trying to implement this algorithm: http://www.jwz.org/doc/threading.html It's essentially an imperative / OO algorithm which makes it kind of hard to...
... The pointer. In ocaml everything that is not an int (or something that is represented internaly by an int, as char, bool, and constructor with no...
... Something like this, perhaps? type id = string type message = { subject : string; message_id : id; references : id list; } type container = { mutable...
... The most important part of that algorithm is part one. This is a dumb/straightforward/fast tree reconstruction from incomplete information. If you use the...
... One of them is in [Forest.link]: I forgot to update the children list of [nb]. Another point that might confuse you is that I assumed a reverse order for...
I downloaded the OCaml package from http://caml.inria.fr/ocaml/distrib.html and installed it...by accident without installing XCode first (I had already...
... It installs the files in a number of locations: The executables go in /usr/local/bin; the libraries go in /usr/local/lib/ocaml/*; the man pages in...
... Where did you set the prefix to? If you're not totally married to compiling vanilla OCaml by yourself, I would recommend using either Fink's version of...
Thanks everyone. I found it in /usr/local/bin as you suggested. I did get command not found on ocaml. Then when I tried rehash I got command not found again!...
... If you're using csh: setenv PATH /usr/local/bin:${PATH} If you're using bash: export PATH=/usr/local/bin:$PATH Note that there are no spaces before and...
... Thanks. This code was very helpful indeed. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ -...
When I run the following simple code, I get the Exception: Sys_error "Bad file descriptor". let aux l i1 = let s = input_line i1 in s::l let f fname = let i =...
... ^^^^ This expression doesn't "return l1" as you might be thinking, thus the ... is always called. 'f1' is an infinite loop. Rich. -- Richard Jones....
Thank you for your comment. Here I revised it. Now it works well and also is tail called. let aux l i1 = let s = input_line i1 in s::l let f fname = let i =...
Hi, I thoroughly enjoy and take advantage of the compile-time type safety in Objective Caml. It gives me a good idea that my program is "correct," so I don't...
... Whenever I call a function I look at all the exceptions that might be thrown. This is easy for library functions because the exceptions are documented. In...
... [...] ... In fact there is no easy way to find automaticly which exception can be raised because of higer order function : let g f x = f x may raise any...
Hello all, I have the following in my .mli file: <--- (nrp_thread.mli) (** Helper function to make sure we don't leak a mutex lock in case of exceptions. *) ...
... That's the OCaml convention for specifying directories relative to the standard library directory. See page 146 of the OCaml 3.08 manual for more detail. ...
Where can I find a clear description of how OCaml executes code. In particular, I want to understand when functions with several values are evaluated - is the...
andrew cooke
andrew@...
Nov 3, 2004 7:03 pm
2734
... No, for example # let f1 x = x;; val f1 : 'a -> 'a = <fun> # let f2 x = -x;; val f2 : int -> int = <fun> # let example1 a b x = let a' = f1 a in let b' =...