emacs-devel
[Top][All Lists]
Advanced

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

Re: cl-lib warnings


From: Stefan Monnier
Subject: Re: cl-lib warnings
Date: Sat, 24 Dec 2022 20:21:24 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> I find it very interesting how many Emacs Lisp programmers want to use a
> highly functional, Scheme-inspired style -- e.g. the recommendation in
> this thread to use named-let -- despite how the roots of Emacs Lisp are
> highly imperative.

What can I say, I'm a pure functional programmer at heart (my own
experimental language is pure, statically (and dependently) typed, and
strongly normalizing).

FWIW, if you use `named-let` consciously/carefully enough (i.e. so all
the "recursive" calls are in tail position) the resulting code is
a plain old imperative `while` loop using `setq` to update
iteration variables.

That's actually the main problem with `named-let`: it's a bit too easy to
use non-tail-recursive calls, which are not only more costly but eat up
the stack.  Maybe we should have a version of it that signals an error
if there are non-tail-recursive calls.


        Stefan




reply via email to

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