English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
[Caml-list] Accuracy of Gc.stat ()
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-22 (11:44)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Accuracy of Gc.stat ()
On Sat, Nov 22, 2003 at 01:20:54AM +0100, Kim Nguyen wrote:
> external is_bytecode : unit -> bool = "is_bytecode_bytecode" "is_bytecode_native"

Neat trick. This _ought_ to work, but it doesn't for some reason:

	let arg = (true, false) 
	external is_bytecode : bool * bool -> bool = "%field0" "%field1" 
	let () = 
	  if is_bytecode arg then 
	    print_endline "Bytecode!" 
	    print_endline "Native!" 

Perhaps someone can explain why ...


Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
"One serious obstacle to the adoption of good programming languages is
the notion that everything has to be sacrificed for speed. In computer
languages as in life, speed kills." -- Mike Vanier