Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-21 Thread Lute Kamstra
David Kastrup <[EMAIL PROTECTED]> writes: > Lute Kamstra <[EMAIL PROTECTED]> writes: > >> David Kastrup <[EMAIL PROTECTED]> writes: >> >>> And I am not too fond of quadratic complexity algorithms. >> >> Me neither, but I was lazy and adapted assq-delete-all. >> >>> If one takes >>> (defun checkit

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-21 Thread Richard Stallman
> Strange, (cadr ...) is just a defsubst for (car (cdr ...)). So > compiled it should make no difference. The defsubst binds and unbinds x. I consider that a byte compiler deficiency. In general, the byte compiler cannot omit that binding. It does not know that the binding won't

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-21 Thread Richard Stallman
I guess this is enough potential uses to justify a harmless small function. ___ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-20 Thread Lute Kamstra
Richard Stallman <[EMAIL PROTECTED]> writes: > I could use it for removing things from auto-mode-alist: > > That is one plausible use. Are there others? I did a quick grep on Emacs' sources and found a couple of places where rassq-delete-all could be used: ,[ files.el ] |(de

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-20 Thread Richard Stallman
I could use it for removing things from auto-mode-alist: That is one plausible use. Are there others? ___ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-20 Thread David Kastrup
Lute Kamstra <[EMAIL PROTECTED]> writes: > David Kastrup <[EMAIL PROTECTED]> writes: > >> And I am not too fond of quadratic complexity algorithms. > > Me neither, but I was lazy and adapted assq-delete-all. > >> If one takes >> (defun checkit () >> (setq x nil) >> (dotimes (i 11) (push (c

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-20 Thread Lute Kamstra
Richard Stallman <[EMAIL PROTECTED]> writes: > lisp/subr.el currently defines assq-delete-all. What about providing > rassq-delete-all as well? > > Why? > > I don't want to add functions to Emacs merely for completeness' sake. I could use it for removing things from auto-mode-alist: Ind

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-19 Thread Richard Stallman
lisp/subr.el currently defines assq-delete-all. What about providing rassq-delete-all as well? Why? I don't want to add functions to Emacs merely for completeness' sake. ___ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/ma

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-19 Thread Lute Kamstra
David Kastrup <[EMAIL PROTECTED]> writes: > Lute Kamstra <[EMAIL PROTECTED]> writes: > >> lisp/subr.el currently defines assq-delete-all. What about providing >> rassq-delete-all as well? >> >> Lute. >> >> >> (defun rassq-delete-all (value alist) >> "Delete from ALIST all elements whose cdr is

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-19 Thread David Kastrup
Lute Kamstra <[EMAIL PROTECTED]> writes: > lisp/subr.el currently defines assq-delete-all. What about providing > rassq-delete-all as well? > > Lute. > > > (defun rassq-delete-all (value alist) > "Delete from ALIST all elements whose cdr is `eq' to VALUE. > Return the modified alist. > Elements

Re: Adding rassq-delete-all to lisp/subr.el.

2005-04-19 Thread Lute Kamstra
Lute Kamstra <[EMAIL PROTECTED]> writes: > (defun rassq-delete-all (value alist) > "Delete from ALIST all elements whose cdr is `eq' to VALUE. > Return the modified alist. > Elements of ALIST that are not conses are ignored." > (let ((tail alist)) > (while tail > (when (and (consp (c

Adding rassq-delete-all to lisp/subr.el.

2005-04-19 Thread Lute Kamstra
lisp/subr.el currently defines assq-delete-all. What about providing rassq-delete-all as well? Lute. (defun rassq-delete-all (value alist) "Delete from ALIST all elements whose cdr is `eq' to VALUE. Return the modified alist. Elements of ALIST that are not conses are ignored." (let ((tail a