How do I have multiple implementations of a module use one interface (without using Objects). For instance: Interface: Tree Implementations: BinaryTree,...
... Easiest way I've found is this: let insert_list f l = let rec insert f l = [] -> () ... if (List.length l) < 2) then failwith "List too short" else insert...
... Yes, you just need to define a module signature Tree and then modules BinaryTree etc. which adhere to this signature: module type TREE = sig val foo : int ...
... There are a couple of ways you can do this, e.g. functors would work, but they're likely overkill for this. The best way is to probably use module types....
... Well, a couple of others have given good answers, so I won't repeat what they said. You should know, however, that when you are using implicit interfaces...
... what ... don't ... ml/mli files: That's what I was wondering about (sorry i left that important detail out...). I knew about the toplevel idea, but...
Hi, Has anyone used ocaml for web cgi scripts (on apache)? Im looking for a tutorial that shows how to use ocamlnet to parse and use arguments, to process...
Rakotomandimby (R12y)...
mihamina.rakotomandim...
May 1, 2005 9:27 pm
3285
You're probably looking for this: http://merjis.com/mod_caml_for_beginners ... -- Robert Wills <robert.wills@...>...
Robert Wills
robert.wills@...
May 1, 2005 10:23 pm
3286
I would really appreciate just a litlle help toward uninstalling this Ocaml from my computer. Is there an uninstall file that I either cant find or was not...
... May be :-) It's an Error 500 when I visited it. I'll have look at it a bit later. -- ASPO Infogérance http://aspo.rktmb.org/activites/infogerance ...
Rakotomandimby (R12y)...
mihamina.rakotomandim...
May 1, 2005 10:39 pm
3288
... First, dont excpect people to guess things only you know: - What version arre you talking about? - I guessed (may be I'm wrong) you're running Linux or...
Rakotomandimby (R12y)...
mihamina.rakotomandim...
May 1, 2005 10:44 pm
3289
Thank you thank you thank you ! I downloaded and installed the pre-compiled Ocaml package for Mac OS X Specifically, i installed version 3.08.3 of Ocaml...
Here is a little more detail on what Unix I have , underpinning Mac OS X 10.3.9 : "The BSD incorporated into Mac OS X is known as Darwin. It is available as a...
... If you did a default build (i.e. you didn't muck about with the --prefix options in the config phase of the build), then you should be able to just remove...
http://merjis.com/developers/mod_caml/ is the right URL. Note that this is a set of bindings for the Apache API which happens to run CGI scripts too (in the...
... [...] IMHO it looks like a need for an extension of the Ocaml-syntax to write it in this way. It could be done in this way: exception Invalid_arguments ...
Oliver Bandel
oliver@...
May 2, 2005 7:28 pm
3294
Hello, ... Well, there is an "include" for signature, but not for structures. Wouldn't it make sense to have something like that? Include_struct "tree.ml" or ...
Oliver Bandel
oliver@...
May 2, 2005 7:29 pm
3295
... Definitely. ... You can do this: # let l = [ `A; `B ];; val l : [> `A | `B ] list = [`A; `B] # `C :: l;; - : [> `A | `B | `C ] list = [`C; `A; `B] #...
... open Tree or #load "file-name";; Load in memory a bytecode object file (.cmo file) produced by the batch compiler ocamlc. #use "file-name";; Read, compile...
Frederic GAVA
frederic.gava@...
May 2, 2005 9:18 pm
3297
... [...] But these commands are only working i the toplevel... Ciao, Oliver...
Oliver Bandel
oliver@...
May 3, 2005 6:28 am
3298
... Another advatage is subtyping and so coercion: let color_from_bw x = (x : bw :> color) and if you do a let z = `Black z can be used where something of type...
... Actually, it seems to be the inverse: ... let foo = 0 ... include Incl let bar = foo + 1 ... ocamlc -c incl.ml ocamlc -c incl2.ml but you cannot have an...
Hi, I am trying to make an ocaml program communicate with a java one... right now, i've made it through sockets and XML but it's quite heavy... :-( I am just...
... Xavier Leroy has some software which may help you: http://pauillac.inria.fr/~xleroy/software.html#camljava Rich. -- Richard Jones, CTO Merjis Ltd. Merjis -...
Hello, I am trying to get a C-file that calls Matlab libraries to work with OCaml. The C-file is compiled with the Matlab's mex script. However, this creates a...
I am having trouble understanding tail recursion. I have read the posts about tail recursion in the archives, and I have used google to look up articles on...
... let f x = let rec aux x acc = if x = 1 then acc else aux (x - 1) (acc + (x*2)) in aux x 1 This is the tail recursive version. A function is tail recursive...
... [.. snipped ..] ... let g x = let rec newf x a = if x = 1 then a else newf (x-1) (a + x*2) in newf x 2;; A function is tail recursive if the result of the...
... OK, let me try :-) The result of the recursive call must be the result which is returned, without passing through any processing. Note that the question is...