Hi, I'm writing a couple of modules implementing a binary tree. Im proceeding adding a functions one by one becouse of checking with ocaml interpreter. Here...
... ARGH! I lost lots of time checking errors like theese, anyone knows if is there a possibility to let ocaml interpreter highlight the error line? It only...
... It should underline the error by default. Are you using Windows or something? -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for...
On Tue, Nov 01, 2005 at 12:59:21PM +0100, Java wrote: [...] Someone else has found the obvious error; I have a few other ... You're using tuples as parameters,...
... Well, it does. (********************************************************) Objective Caml version 3.09.0 # type 'a tree = ... let rec search (x, tree) = ...
I'm getting crazy {O.o} first of all a very beginner question: writing "let rec search x tree" is the same as "let rec search (x,tree)"???? (if not pleas...
I want to implement an operator "comp" which shall deliver the composition of two functions. I said let comp : ('b -> 'c) -> ('a -> 'b) -> ('a -> 'c) = fun f g...
... No, it is not. (x, tree) is a tuple, which is a single type/entity/whatever word you want to use. parenthesis and commas are not used in OCaml to...
... No they're not the same. let rec search x tree = (* definition *) defines a recursive function called search which takes two parameters. Whereas: let rec...
... I think this is just because -> is right-associative. The toplevel is just omitting parentheses where it can. Rich. -- Richard Jones, CTO Merjis Ltd. ...
... Ok, but I need to use tuples becouse I'm defining data types for a didattical language. Or probably my teacher knows ML syntax and say us touse Ocaml...
... I think he was referring to OCaml's renaming of his polymorphic parameters. E.g. # type 'blah_blah tree = E ... type 'a tree = E | N of 'a tree * 'a * 'a...
Hi, I need to build a tree datatype defined like this: "type 'a tree = Empty | Node of 'a * 'a tree * 'a tree" How can I print all the leafs in this way? I...
On Tue, 01 Nov 2005 18:51:13 +0100 ... for example: let rec frontiera tree = match tree with ... you can change the placement of the print to change how the...
... Well, there are a couple of problems here. The one you are having now, I'm guessing, is due to your not handling cases like Node (y,Empty,right) ...
... You've already figured out the problem, now I want to solve the problem you were trying to solve- which is probably that you wanted to raise the exception...
... I don't think anyone has mentioned the problem that your leaves (nodes with no children) are all Empty, so there isn't a whole lot to print. ;-) -- Dr Jon...
We have to build a binary tree data structure for out software. And on the tree we distinguish nodes into either ordinary nodes or handles. type node = Leaf of...
... It is isomorphic to what you ordered. OCaml is NOT ignoring your type suggestions, it is simply using different names. This is a subtle distinction, but an...
... The type that you specify is plugged into the unifier and the result of unification is not necessarily the same. For example: # let f : 'a -> 'b = fun x ->...
Hi, While looking at my imperative style code for the set-union algorithm to make it functional I realized that I could speed it up because I was setting ...
... No, "let s_b = v in sequel" creates a new variable named s_b that shadows the variable defined and bound by the match. That new s_b variable is indeed...
Hi Frédéric, ... You are so correct. Obviously I should have seen this. ... Not what I am looking for. In the above we are just setting s_b's value to v's ...
... Well, that's not what you're doing. What "let _ = s_v = ref b in blah" does is check to see if s_v is equal to ref b (i.e. if it is a reference that...