Monday, June 27, 2005

Quickest way to circumvent tail-recursion in Scheme

Replace exp with (values exp).

2 comments:

Anonymous said...

In which implementation is that? I tried Gambit-C, Chicken and Scheme48, and didn't encounter the problem...

Dave Herman said...

I used PLT Scheme.

It's not a problem, though, it's proper behavior by definition. Procedure arguments are in non-tail position.