Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 = List.tl 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?

Charles