... That just means they both take two type arguments (and have the same name). Hashtbl2.t is a new type. ... The right side is a description of the new type. ...
13072
Toby Kelsey
toby.kelsey@...
Jan 2, 2012 12:15 pm
... This is what it looks like with clearer names and indentation, hopefully you can now see how this works. let add tbl key data = let val_list = try ...
I had these functions computed and ordering an xsd list. val flatten : Xsd.xsd list -> Xsd.xsd list val convert_xsds : Xsd.xsd list -> bool array array val...
I suppose the error is in the name_of_num function, which returns an integer that is not a correct index in the list. If you have trouble knowing where an...
I know that was a problem of function name_of_num because its length is too short compare to the list I returned (list equivalence classes). Here is an example...
I still don't see the code for "name_of_num". Could you post a self-contained OCaml code (that is, that can be compiled and executed as is) that exhibits your...
... Quyen, I think Gabriel is asking you to post a complete program. That would be much easier to analyze. ... [Non-text portions of this message have been...
Thanks!! I was trying to post all the code, but it was a group of files. I try to describe it. Here is a part of xsd trees, from this tree I parse into a list...
... So the list of names is ["name";"string";"label";"nonNegativeInteger"] ... How does "string" depend on "name" or "label"? ... You already have the...
... Well, I don't know what those numbers in the other posts are supposed to mean, but (m.(i).(j) && m.(j).(i)) seems to be looking for mutually dependent...
Hi, Thank you for your answers!! After that I see my problem was not that. Here is my question. From this list example: let entries = [("symbol",...
Can someone please explain both the warning and the function's argument type in the following: # let f ?(x=`a) = match x with `a -> 1 | `b -> 2;; Warning 16:...
The warning is because I gave only an optional argument to f. The main question is about the type: # let f ?(x=`a) () = match x with `a -> 1 | `b -> 2;; val f...
For the warning: it means that there is no way to apply f without providing an 'x' argument. As a consequence x is not a 'real' optional argument, hence the...
... Firstly, I don't find this part described in the manual. And I don't see why a value applied to f must contain at least `a. The function will work fine if...
2012/1/6 Ashish Agarwal <agarwal1975@...> ... I'm mostly describing rules that I infered myself, sorry I can't be more formal :o). ... Sorry that was not...
Thanks. That is more clear, but I don't see why f b should not type check. It seems it could. I don't see why giving a default value for an argument should...
Hi Mon Ami, Of course lists are immutable, just when I needed to work around this restriction, I made a mistake in my function: let rec insert elt lst = match...
... AU is the distance between the earth and the sun, and for the other planets, we use fractions of AUs. I started out with [ 1325221860.; 1325243520.;...
Hi Jean 2012/1/9 Jean Saint-Remy <jeansaintremy@...> ... lst is used in the pattern matching (when you say 'match lst with ...'), that is why you don't...
-[ Sun, Jan 08, 2012 at 11:25:13PM -0800, Jean Saint-Remy ]---- ... let rec insert elt lst = match lst with ... else head :: insert elt tail ;; There is no...
In your example it wouldn't hurt, but consider this (admitedly stupid) one: # let f ?(x : 'a = `a) (g : 'a -> int) = match x with `a -> g x | `b -> g x;; val f...
Hi, So sorry, I did not make myself clear. I made a mistake in my function, instead of consing new element with the previous list, I was passing the variable...
You email is still not very clear, but I guess you want to have: let rec map2 f1 f2 = function ... so you can run: # map2 (fun x y -> (y -. x) /. 4) l or for...
I see the example you're after, but in this case x : [< `a | `b ] would still be sufficient because you can't get to the `b branch with the default value `a. I...
Hi, My apologies for making my code look like Lisp. I used too many words before. let fa = [| 1325221860.; 1325243520.; 1325265720.; 1325288280.; |] ;; for...
13098
Toby Kelsey
toby.kelsey@...
Jan 9, 2012 6:14 pm
... So basically you want to interpolate some values in a list. You could add mid-points with something like this: let rec add_mid lst = match lst with ... ...
Hi, Thanks a million. That's a very interesting idea of having a variable declared with keyword "as" inside a rec function. There is however a very very small...