[Top][All Lists]

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

Re: Help with recursive destructive function

From: Michael Heerdegen
Subject: Re: Help with recursive destructive function
Date: Thu, 07 Jun 2018 01:30:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> - It is recursive (on car) instead of iterative.

Yes, that's not good in your use case.

> - It destructively replaces elements based on an alist lookup: if an
>   element matches an alist key, it's replaced with the alist value.

It also handles only lists - it can't traverse arrays, hash tables,
structs, etc.  If you give that all up, however, `cl-sublis' is the
canonical thing you get.

Note that "destructively" doesn't necessarily mean you can reuse the
original structure (which is what you want).  In this case the
implementation seems to guarantee that, however.


reply via email to

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