[plt-scheme] two tool ideas

From: Gregory Cooper (greg at cs.brown.edu)
Date: Fri Feb 14 11:53:22 EST 2003

> I'm not sure we're talking about the same thing when we say 'tail 
> position,' in particular because I don't see how either argument to a 
> cons could ever be in tail position.

It depends on the evaluation strategy.  The runtime could first allocate
an uninitialized cons cell, and evaluation of the arguments could then
"return" into the fields of the cell.  In this case, the second argument
of the cons will sometimes behave as if in tail position.  Wadler's
"listless" work deals with optimizations for such programs, which are said
to be "tail-recursive modulo cons".


Posted on the users mailing list.