emacs-devel
[Top][All Lists]
Advanced

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

Re: CL package serious deficiencies


From: Teemu Likonen
Subject: Re: CL package serious deficiencies
Date: Sun, 12 Feb 2012 17:53:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

* Stefan Monnier [2012-02-11 23:41:07 -0500] wrote:

>>> As for :start :end :from-end and :count, I've never even seen them
>>> used with delete-if.
>> Here's one example:
>>     (defun delete-nth (n sequence)
>>       (delete-if (constantly t) sequence :start n :count 1))
>
> Two problems:
> 1- that can be implemented just as well with pop+nthcdr.

NTHCDR is not an accessor so (pop (nthcdr n list)) doesn't work. Both
POP and NTHCDR are for lists. DELETE-IF is for all sequences.

Those keyword arguments are not useless. Some of them are rarely needed
and that's why it's good that they are &key and not &optional.

I think

    (replace-match "foo" :subexp 2)

is much more readable than

    (replace-match "foo" nil nil nil 2)



reply via email to

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