... Hi Eric, The 'Num' arbitrary-precision library might also be useful if floating-point arithmetic isn't precise enough: ...
Danny Yoo
dyoo@...
Dec 2, 2002 12:22 am
629
I was wondering what are the relative merits (in terms of speed, portability and ease of use) between using arrays of arrays, and the BigArray class. While web...
... Sometime ago I found a library for Ocaml, PsiLAB: they say: "PsiLAB has been developed for scientific research and data analysis" and it remembered me the...
... This would work as well. I wonder if it would be more or less efficient then what I did end up doing which was let some_func xt = match xt with x when x =...
Suppose function f returns a pair. I would like to assign the result to some vector elements: (a.(0),b.(0)) <- f();; Unforuntately, this syntax is illegal. The...
... In your code, values are first calculated as (c,d) and then assigned to a.0 and b.0. The pattern matching expression "let (c,d) = f()" operates by naming ...
... Ocaml value are always reference, so the c (resp d) in a.(0) (resp b.(0) is the same that the one returned by f (well, with the notable exception of...
Consider this example List.map2 (+) [1;2] [3;4];; - : int list = [4; 6] Now consider this List.map2 (*) [1;2] [3;4];; Warning: this is the start of a comment. ...
... you use the " " character : List.map2 ( * ) [1;2] [3;4];; ... Well, I don't know any better direct way. ... It's a good Idea, why don't you do it ? By the...
... Put some spaces in: ( * ) ... Maybe Array.fold_left (+.) 0.0 (Array.mapi (fun i num -> num *. b.(i)) a) ? An Array.fold_lefti seems helpful here; too bad...
... You would use ( * ) and ( *. ) because (* is the beginning of a comment and *) is the end of a comment. ... Here's a very close approximation of the Matlab...
Hi all, my program (babbage.ml) use str and unix library. I would want to link both in my program. (Objective Caml version 3.01) This command allows me to...
pame_la@...
Dec 4, 2002 8:31 pm
645
... ocamlc unix.cma str.cma babbage.ml -o babbage should make it. The custom, cclib and lunix options are AFAIK out of date in Ocaml 3.x Ciao Ernesto...
I would like to find out where an exception is being raised. How can I do this wihtout single stepping my whole program? If I type 'run' inside ocamldebug, it...
Consider the following 2 files: ... let foo = 1;; ... let bar = foo + 1;; In interactive mode, I can type #use "f1.ml";; #use "f2.ml";; and everything is fine....
http://caml.inria.fr/ocaml/htmlman/libref/Sys.html says val interactive : bool Pervasives.ref This reference is initially set to false in standalone programs...
... No, it don't, because open F1 is not an expression. By the way, the true mean to test a module inside a toplevel is : #load "foo.cmo";; then the module Foo...
Hello, some days ago, I had a problem concerning how to restrict a map to a certain type. Thanks to the help of this list, I was able to solve my problem. So I...
Clemens Hintze
ml-ocaml_beginners@...
Dec 6, 2002 4:59 am
653
And by the way did you try and type "back" after program end in the debugger?...
... Usually it's if !Sys.interactive then (<commands>) else (<commands>);; indeed ... IMHO it's normal, nobody could change it at runtime (either you're...
You could #load the already finished files, and #use the currently edited one. #load "f1.ml" would be roughly equivalent to the declaration module F1 = struct...
... interacting ... writing ... global scope. Just my point of view about scope and ref: the (static) scope of a variable is that piece of code where a...
I agree on everything, but there is a strong reason for "global refs" in ocaml; in a functional-featured language, where lambda calculus takes charge gently of...