Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
live variables
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-01-14 (20:20)
From: Charles Martin <martin@c...>
Subject: live variables
I would like to follow up to the mailing list a series of posts on 
comp.lang.functional.  Jerome Vouillon explained that the native code 
compiler compiles

	let rec foldl f q = function
	| [] -> q
	| x :: xx -> foldl f (f q x) xx

as if it were written

	let rec foldl f q = function
	| [] -> q
	| l ->
	  let x = List.hd l in
	  let r = f q x in
	  let xx = l in
	  foldl f r xx

As Daniel Wang points out, this does not preserve the basic liveness 
properties of the original program.  As he asked on the newsgroup, is there 
a deep reason for this, or is this just a bug that has yet to be fixed?