Dmitry, Thanks a lot for the patch. I was finally able to test it and it fixes my problem. I have been able to successfully compile and install Ocaml 3.08.2...
Hi, I've been using Ocaml for some time now, but have not tried profiling before (iirc). When I run my program after compiling with "ocamlopt -p" I get a...
andrew cooke
andrew@...
Dec 6, 2004 1:00 pm
2807
Ah. I need to run the program for longer to get more sample hits. The sampling is apparently finer on Linux, for some reason. Andrew ... -- ` __ _ __ ___...
andrew cooke
andrew@...
Dec 6, 2004 1:50 pm
2808
I've just started working with ocaml, trying out various functions. The following code let data = [1,2,3,4,5,6];; let s = (List.fold_left (+) data) in...
In fact let data = [1,2,3,4,5,6];; defines a list containing only one element: the 6-tuple (1,2,3,4,5,6). I think you mean let data = [1;2;3;4;5;6];; -- ...
... A list constant is delimited with ';'. What you have there is a list with one element which is six-tuple. What you want is: let data = [1;2;3;4;5;6];; ......
... Welcome to the tribe! ... Okay, there are two problems with your code. First, your list syntax: list element are separated with semicolons, not commas. So...
Hi, let data=[1;2;3;4;5;6] !!!!! "," is for nuple (1,2,3,4,5) is a 5-uple of type int * int * int * int * int [1;2;3;4;5] is a list of type int list Cheers ...
Frédéric Gava
frederic.gava@...
Dec 8, 2004 9:32 pm
2813
... Not true. first::rest will not match the empty string, and the empty string will not match any non-empty string, so you can put the patterns in either...
... Hello, ocaml sees '(*' as the beginning of a comment, and it just waits for you to close it by '*)'. Use '( * )' instead, so that no confusion will be...
... ^^^^^ (*) starts a comment try ( * ) I got a warning "This is a start of a comment." And now it says "*) : this is not the end of a comment." Heiko...
Evidently, I don't get exponentiation and/or the map function. After: open List;; let listIn = [1;2;3;4];; let listFloat = (map ( float ) listIn);; The...
... ( **2. ) is not a valid ocaml expression. In fact, ** is an infix operator, and you can use it in two ways: - x ** y - ( ** ) x y in the latter,...
This seems to work. Remember the spaces; (**) would be the start of a comment. # let listSquares = (map ( ( ** ) 2. ) listFloat) in List.iter (fun y -> ...
... Well, it runs. But it clearly doens't do what he expects it to do. That's because ( ( ** ) 2. ) is the function f(x)=2^x, and not f(x)=x^2 like he wanted....
... Right. I wanted squares of numbers not powers of two. Here's what I was working on at the time, s program that computes a standard deviation: (Note:...
... The map and fold functions are definitely in the function spirit. I would avoid using an object at all, and just create a standard deviation function: open...
Hello ocamlers, yesterday Joe Polanik came up with a program reading lines from "Deviation.dat". I changed 'getData' to what I think is functional progamming...
... My understanding is that OCaml does not specify the order in which it evaluates the arguments to a function. In your case, the function is the (::)...
... Actually, I did that first and came up with something very similar. But I was uncomfortable with all those 'in' statements. Do successive 'in' statements...
... They do, but you don't need to worry about this. I happily write code like this: let foo = ... in let foo = ... in let bar = ... in etc. Note that it's...
... I'm sure there are cases where reusing names is useful, and this may be one of them--it appears here that, conceptually speaking, the first and second...
On Sat, 11 Dec 2004 03:28, Joe Polanik wrote: [SNIP] ... Yep, as long as all objects are of the same type. ... Yep again. Here is how you'd return a reference...
... [good discussion of when to reuse names, and when not] Another way to write this which also avoids leaking names is to use further nesting: let page = let...