[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: named-let

From: Stefan Monnier
Subject: Re: named-let
Date: Sat, 09 Jan 2021 16:48:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> (Back on topic: I grew some affection for the named let
>> from the Scheme/Guile side, so thanks for that, too)
> Hmpf, I prefer loop/recur... *grumblegrumble*


    (defmacro loop (&rest r)
      `(named-let recur . ,r))

does the trick AFAIK, except that it won't signal an error for uses of
`recur` which aren't recognized as tail-calls.

It would be easy to make a replacement of `cl-labels` which signals an
error if the recursice calls aren't recognized as tail-calls (the
current code already tests for it, but only in order to optimize the
`letrec` into a `let*` rather than to signal an error).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]