help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp?


From: Stefan Monnier
Subject: Re: Why aren't `find`, `find-if`, `remove-if` part of Emacs Lisp?
Date: Wed, 25 Jun 2014 09:35:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> Agreed.  They also work OK for macros since those are not supposed to be
>> executed at run-time.  Keyword arguments are particularly problematic in
>> Elisp where the language implementations are all fairly simplistic with
>> very limited optimizations.
> That might be a description of todays implementation.  I would assume
> that you could compile away the keyword parameters relativly easily: you
> basically attach a define-compiler-macro (another CL macro) which maps
> the keyword parameters to positional parameters.

Of course, cl-lib does this kind of thing, but it's a lot of work, so it
only covers some cases, and if you ever want to pass `member' to another
function define-compiler-macro won't help you and you get a major
performance penalty.

I agree with you that naming arguments can be *very* helpful.  But given
the current state of Elisp implementation, using keyword arguments with
functions that might be performance sensitive is not a good idea.


        Stefan


reply via email to

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