[Top][All Lists]

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

Re: killing the result of isearch

From: Emanuel Berg
Subject: Re: killing the result of isearch
Date: Mon, 20 Nov 2017 04:24:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Tomas Nordin wrote:

> But there will be only one level of recursion
> that I am aware of. Is a recursive function
> call slower than a regular function call?
> I am aware there is a maximum
> recursion depth.

Here is what it says in the manual [1]

    Use iteration rather than recursion
    whenever possible. Function calls are slow
    in Emacs Lisp even when a compiled function
    is calling another compiled function.

Which is what I said, right? But it also says

    Using the primitive list-searching
    functions ‘memq’, ‘member’, ‘assq’, or
    ‘assoc’ is even faster than explicit
    iteration. It can be worth rearranging
    a data structure so that one of these
    primitive search functions can be used.

"Explicit iteration" = e.g., a `while' loop
with a condition and the increment of
a variable. This is everyday loop usage in
languages such as C, C++ ...

"Primitive" = "A 'primitive function' is
a function callable from Lisp but written in
the C programming language." [2]

[1] (info "(elisp) Compilation Tips"
[2] (info "(elisp) Primitive Function Type")

underground experts united

reply via email to

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