comparison src/fns.c @ 5338:8608eadee6ba

Move #'delq, #'delete to Lisp, adding support for sequences. src/ChangeLog addition: 2011-01-11 Aidan Kehoe <kehoea@parhasard.net> * device-msw.c (Fmswindows_printer_list): Remove a Fdelete () call here, remove the necessity for it. * fns.c (Fdelete, Fdelq): * lisp.h: Move #'delete, #'delq to Lisp, implemented in terms of #'delete* * select.c (Fown_selection_internal): * select.c (handle_selection_clear): Use delq_no_quit() in these functions, don't reimplement it or use Fdelq(), which is now gone. lisp/ChangeLog addition: 2011-01-11 Aidan Kehoe <kehoea@parhasard.net> * subr.el (delete, delq, remove, remq): Move #'remove, #'remq here, they don't belong in cl-seq.el; move #'delete, #'delq here from fns.c, implement them in terms of #'delete*, allowing support for sequences generally. * update-elc.el (do-autoload-commands): Use #'delete*, not #'delq here, now the latter's no longer dumped. * cl-macs.el (delete, delq): Add compiler macros transforming #'delete and #'delq to #'delete* calls.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 14 Jan 2011 23:35:29 +0000
parents 287499ff4c5f
children 94bbd4792049 a9094f28f9a9
comparison
equal deleted inserted replaced
5337:906ccc7dcd70 5338:8608eadee6ba
3135 test, key, start, end, from_end, default_, Qposition); 3135 test, key, start, end, from_end, default_, Qposition);
3136 3136
3137 return object; 3137 return object;
3138 } 3138 }
3139 3139
3140 DEFUN ("delete", Fdelete, 2, 2, 0, /*
3141 Delete by side effect any occurrences of ELT as a member of LIST.
3142 The modified LIST is returned. Comparison is done with `equal'.
3143 If the first member of LIST is ELT, there is no way to remove it by side
3144 effect; therefore, write `(setq foo (delete element foo))' to be sure
3145 of changing the value of `foo'.
3146 Also see: `remove'.
3147 */
3148 (elt, list))
3149 {
3150 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
3151 (internal_equal (elt, list_elt, 0)));
3152 return list;
3153 }
3154
3155 DEFUN ("old-delete", Fold_delete, 2, 2, 0, /* 3140 DEFUN ("old-delete", Fold_delete, 2, 2, 0, /*
3156 Delete by side effect any occurrences of ELT as a member of LIST. 3141 Delete by side effect any occurrences of ELT as a member of LIST.
3157 The modified LIST is returned. Comparison is done with `old-equal'. 3142 The modified LIST is returned. Comparison is done with `old-equal'.
3158 If the first member of LIST is ELT, there is no way to remove it by side 3143 If the first member of LIST is ELT, there is no way to remove it by side
3159 effect; therefore, write `(setq foo (old-delete element foo))' to be sure 3144 effect; therefore, write `(setq foo (old-delete element foo))' to be sure
3161 */ 3146 */
3162 (elt, list)) 3147 (elt, list))
3163 { 3148 {
3164 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, 3149 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
3165 (internal_old_equal (elt, list_elt, 0))); 3150 (internal_old_equal (elt, list_elt, 0)));
3166 return list;
3167 }
3168
3169 DEFUN ("delq", Fdelq, 2, 2, 0, /*
3170 Delete by side effect any occurrences of ELT as a member of LIST.
3171 The modified LIST is returned. Comparison is done with `eq'.
3172 If the first member of LIST is ELT, there is no way to remove it by side
3173 effect; therefore, write `(setq foo (delq element foo))' to be sure of
3174 changing the value of `foo'.
3175 */
3176 (elt, list))
3177 {
3178 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
3179 (EQ_WITH_EBOLA_NOTICE (elt, list_elt)));
3180 return list; 3151 return list;
3181 } 3152 }
3182 3153
3183 DEFUN ("old-delq", Fold_delq, 2, 2, 0, /* 3154 DEFUN ("old-delq", Fold_delq, 2, 2, 0, /*
3184 Delete by side effect any occurrences of ELT as a member of LIST. 3155 Delete by side effect any occurrences of ELT as a member of LIST.
11788 DEFSUBR (Fold_rassq); 11759 DEFSUBR (Fold_rassq);
11789 11760
11790 DEFSUBR (Fposition); 11761 DEFSUBR (Fposition);
11791 DEFSUBR (Ffind); 11762 DEFSUBR (Ffind);
11792 11763
11793 DEFSUBR (Fdelete);
11794 DEFSUBR (Fold_delete); 11764 DEFSUBR (Fold_delete);
11795 DEFSUBR (Fdelq);
11796 DEFSUBR (Fold_delq); 11765 DEFSUBR (Fold_delq);
11797 DEFSUBR (FdeleteX); 11766 DEFSUBR (FdeleteX);
11798 DEFSUBR (FremoveX); 11767 DEFSUBR (FremoveX);
11799 DEFSUBR (Fremassoc); 11768 DEFSUBR (Fremassoc);
11800 DEFSUBR (Fremassq); 11769 DEFSUBR (Fremassq);