Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Re : [Caml-list] Hashtbl.find_all Stack overflow
@ 2006-12-11 23:06 Matthieu Wipliez
  0 siblings, 0 replies; only message in thread
From: Matthieu Wipliez @ 2006-12-11 23:06 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

Hello,

have you tried using the functorial version with a suitable compare function (ie not Pervasives.compare) ?
I don't know about the type of the keys, so it is just a guess...

Hope that helps,
Matthieu

----- Message d'origine ----
De : "jhsu1@email.sjsu.edu" <jhsu1@email.sjsu.edu>
À : caml-list@yquem.inria.fr
Envoyé le : Lundi, 11 Décembre 2006, 19h18mn 15s
Objet : [Caml-list] Hashtbl.find_all Stack overflow


I get a stack overflow with the following

<PRE>
let var_lookup = Hashtbl.create 997;;

(* ... *)

let keys h = Hashtbl.fold (fun key data accu -> if not (List.mem key accu) then
key :: accu else accu) h [] in
    let files = keys var_lookup in
        let helper file = (let vars = Hashtbl.find_all var_lookup file in
        let run_tpl var = print_string var in
        List.iter run_tpl vars) in
        List.iter helper files;
</PRE>

Only when Hashtbl.find_all is executed enough times.

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs







	

	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

[-- Attachment #2: Type: text/html, Size: 2456 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-11 23:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-11 23:06 Re : [Caml-list] Hashtbl.find_all Stack overflow Matthieu Wipliez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox