Re: CL idiom for Scheme's named let




Marcin 'Qrczak' Kowalczyk <qrczak@xxxxxxxxxx> writes:

> Russell McManus <russell_mcmanus@xxxxxxxxx> writes:
>
>> I'm wondering whether it's possible to write in portable CL
>> named-let such that it guarantees iterative behavior when tail
>> calls are made, supports funcall, and works right for non-tail
>> calls.
>
> It depends which kinds of tail calls are supposed to be guaranteed
> to be run without growing the stack.

The macro that I am thinking of writing would look for combinations
with operators referring to the named let symbol (direct calls in your
parlance), which are also in a tail position, and use a GO in these
cases. There would also be a local function introduced that would be
picked up for all other cases.

I think the above approach would work for example 2 but not example 1.

-russ

.