Hello, my team mate is triggered in a possible bug by compiling an ocaml-program under ocaml 11.1 using Bigarray-module. The ocaml-package is self-compiled...
11598
rixed@...
rixed
Dec 2, 2009 2:56 pm
Let's say I have a list, and want to code a function that calls a user function for each possible pairs of distinct elements of the list, once. Something like...
11599
Eric Cooper
ecc@...
Dec 2, 2009 3:16 pm
... let iterpairs f lst = List.iter (fun x -> List.iter (fun y -> if x <> y then f x y) lst) lst...
11600
Martin DeMello
martindemello
Dec 2, 2009 3:21 pm
let rec iterpairs f l = match l with ... begin List.iter (f x) xs; iterpairs f xs end in let p x y = Printf.printf "(%d %d)" x y in iterpairs p [1; 2; 3; 4; 5]...
11601
Hugo Ferreira
hugotwo3
Dec 2, 2009 3:23 pm
... $ ocaml Objective Caml version 3.10.2 # let f acc e1 e2 = (Printf.sprintf "(%d, %d)" e1 e2) :: acc let fold_pairs f l = let rec loop l acc = match l with ...
11602
Eric Cooper
ecc@...
Dec 2, 2009 3:29 pm
... Sorry, that should be "<" (or ">") rather than "<>". It's structural comparison, so GC triggered by f isn't a problem....
11603
Martin Jambon
BioMim
Dec 2, 2009 3:38 pm
... Here is my version: let rec iter f = function [] -> () ... List.iter (f x) l; iter f l # iter (fun i j -> Printf.printf "(%i, %i)\n" i j) [ 1; 2; 3 ];; (1,...
11604
rixed@...
rixed
Dec 2, 2009 4:14 pm
Wonderful solutions. Thank you !...
11605
Zheng Li
zheng_li@...
Dec 2, 2009 4:31 pm
Hi, ... let any2 f l = List.fold_right (fun x r -> List.iter (f x) r; x::r) l []; () ... Cheers Zheng...
11606
Richard Jones
rwmjones
Dec 2, 2009 4:57 pm
... [...] ... There's not much to go on. At the very least we'd want to see the contents of registers when it segfaults. However it's not likely that anyone...
11607
Hugo Ferreira
hugotwo3
Dec 3, 2009 10:38 am
Hello, I tried the example of loading the Num module as indicated in: http://www.cocan.org/tips_for_using_the_ocaml_toplevel Cannot seem to load the Random...
11608
Martin DeMello
martindemello
Dec 3, 2009 10:57 am
... Random seems to be available by default. Also, if you do #use "topfind";; #list;; there is no random listed. martin...
11609
Romeyke, Andreas
andreas.romeyke@...
Dec 3, 2009 10:58 am
Hello, ... Hmm, ok. ... I will try to reduce the program as small as possible. There was an additional fact found, if we start the compiled program on a clean...
11610
Rakotomandimby Mihamina
rakotomandim...
Dec 3, 2009 11:01 am
... #list;; Will ist aavailable modules. -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 33 11 207 36...
11611
Hugo Ferreira
hugotwo3
Dec 3, 2009 11:13 am
To Martin and Mihamina, ... Correct. Seem to have a problem elsewhere. Thank you, Hugo F....
11612
Richard Jones
rwmjones
Dec 4, 2009 7:46 pm
... You don't need to load the Random module. It's included in the standard library which is always available: $ rlwrap ocaml Objective Caml version 3.11.1 #...
11613
Hugo Ferreira
hugotwo3
Dec 5, 2009 9:36 am
... You understood correctly. My mistake. My code snippet works. Thanks, Hugo F....
11614
Martin DeMello
martindemello
Dec 5, 2009 11:52 pm
I'm trying to get MLGame compiling against the latest OCaml and OCamlSDL. make fails with ... $ make Calculating dependencies of: MLG/video.mli Compiling:...
11615
Richard Jones
rwmjones
Dec 6, 2009 4:45 pm
... [...] ... [...] ... You mean, why does the compiler need to know the real type at that point? Or do you mean 'constructor39; in the sense of constructing ...
11616
Martin DeMello
martindemello
Dec 6, 2009 6:10 pm
... Well, the type *exists* because the SDL code itself uses it all over the place. There's just the abstract "type surface" in sdlvideo.ml and I assume it's...
11617
Romeyke, Andreas
andreas.romeyke@...
Dec 7, 2009 7:14 am
Hello, ... Does the compiler find the include-directory (Ocaml-directory)? Still exists the sdl-subdirectory there? (check with ocamlc -v, it should point to...
11618
Johannes Kanig
johanneskanig
Dec 7, 2009 8:21 am
... Strange, i tried it and it compiles fine; I'm on a recent Ubuntu, I installed ocaml and libsdl-ocaml-dev using the package system. MLGame compiles fine....
11619
Martin DeMello
martindemello
Dec 7, 2009 9:44 am
... Ah, that's good to know! It's probably an environment issue, then (I'm using godi). I'll play with the makefile till it compiles. martin...
11620
Martin DeMello
martindemello
Dec 7, 2009 5:04 pm
On Mon, Dec 7, 2009 at 12:43 PM, Romeyke, Andreas ... Thanks, that was it! The makefile expected sdl to be in the same directory as the stdlib, whereas godi...
11621
Johan Mazel
johan.mazel
Dec 8, 2009 2:56 pm
Hi I'm trying to do pattern matching on a value of type ICMP.Icmp.o. this value is icmp obtained through let icmp = ICMP.Icmp.unmarshal ip#data_env in. The...
11622
johan.mazel
Dec 8, 2009 4:21 pm
... Actually my code looks like: let icmp = ICMP.Icmp.unmarshal ip#data_env in match icmp with ... ( ...
11623
remi.vanicat@...
dl_ens
Dec 8, 2009 5:33 pm
... EchoReply has one argument, you must take it into account: Actually my code looks like: let icmp = ICMP.Icmp.unmarshal ip#data_env in match icmp with ... ...
11624
Richard Jones
rwmjones
Dec 8, 2009 5:37 pm
... ^^ ^^^^^^^^^^^^^ What is the "of" doing there? What is the type assertion for? Rich. -- Richard Jones Red Hat...
11625
Richard Jones
rwmjones
Dec 8, 2009 5:37 pm
... Again, the type assertion isn't necessary and is probably a syntax error. But the main thing is you're missing the required argument to ... Rich. -- ...
11626
johan.mazel
Dec 8, 2009 7:06 pm
... Thanks a lot for all your help. It's now working. Johan Mazel...