comparison src/fns.c @ 5468:a9094f28f9a9

Merge with trunk.
author Mats Lidell <matsl@xemacs.org>
date Wed, 19 Jan 2011 22:35:23 +0100
parents 89331fa1c819 8608eadee6ba
children 0af042a0c116
comparison
equal deleted inserted replaced
5457:4ed2dedf36a1 5468:a9094f28f9a9
3119 { 3119 {
3120 Lisp_Object object = Qnil, item = args[0], sequence = args[1]; 3120 Lisp_Object object = Qnil, item = args[0], sequence = args[1];
3121 Boolint test_not_unboundp = 1; 3121 Boolint test_not_unboundp = 1;
3122 check_test_func_t check_test = NULL; 3122 check_test_func_t check_test = NULL;
3123 3123
3124 PARSE_KEYWORDS (Fposition, nargs, args, 9, 3124 PARSE_KEYWORDS (Ffind, nargs, args, 9,
3125 (test, if_, test_not, if_not, key, start, end, from_end, 3125 (test, if_, test_not, if_not, key, start, end, from_end,
3126 default_), 3126 default_),
3127 (start = Qzero)); 3127 (start = Qzero));
3128 3128
3129 check_test = get_check_test_function (item, &test, test_not, if_, if_not, 3129 check_test = get_check_test_function (item, &test, test_not, if_, if_not,
3130 key, &test_not_unboundp); 3130 key, &test_not_unboundp);
3131 3131
3132 position (&object, item, sequence, check_test, test_not_unboundp, 3132 position (&object, item, sequence, check_test, test_not_unboundp,
3133 test, key, start, end, from_end, Qnil, Qposition); 3133 test, key, start, end, from_end, default_, Qposition);
3134 3134
3135 return object; 3135 return object;
3136 } 3136 }
3137 3137
3138 DEFUN ("delete", Fdelete, 2, 2, 0, /*
3139 Delete by side effect any occurrences of ELT as a member of LIST.
3140 The modified LIST is returned. Comparison is done with `equal'.
3141 If the first member of LIST is ELT, there is no way to remove it by side
3142 effect; therefore, write `(setq foo (delete element foo))' to be sure
3143 of changing the value of `foo'.
3144 Also see: `remove'.
3145 */
3146 (elt, list))
3147 {
3148 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
3149 (internal_equal (elt, list_elt, 0)));
3150 return list;
3151 }
3152
3153 DEFUN ("old-delete", Fold_delete, 2, 2, 0, /* 3138 DEFUN ("old-delete", Fold_delete, 2, 2, 0, /*
3154 Delete by side effect any occurrences of ELT as a member of LIST. 3139 Delete by side effect any occurrences of ELT as a member of LIST.
3155 The modified LIST is returned. Comparison is done with `old-equal'. 3140 The modified LIST is returned. Comparison is done with `old-equal'.
3156 If the first member of LIST is ELT, there is no way to remove it by side 3141 If the first member of LIST is ELT, there is no way to remove it by side
3157 effect; therefore, write `(setq foo (old-delete element foo))' to be sure 3142 effect; therefore, write `(setq foo (old-delete element foo))' to be sure
3159 */ 3144 */
3160 (elt, list)) 3145 (elt, list))
3161 { 3146 {
3162 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, 3147 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
3163 (internal_old_equal (elt, list_elt, 0))); 3148 (internal_old_equal (elt, list_elt, 0)));
3164 return list;
3165 }
3166
3167 DEFUN ("delq", Fdelq, 2, 2, 0, /*
3168 Delete by side effect any occurrences of ELT as a member of LIST.
3169 The modified LIST is returned. Comparison is done with `eq'.
3170 If the first member of LIST is ELT, there is no way to remove it by side
3171 effect; therefore, write `(setq foo (delq element foo))' to be sure of
3172 changing the value of `foo'.
3173 */
3174 (elt, list))
3175 {
3176 EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
3177 (EQ_WITH_EBOLA_NOTICE (elt, list_elt)));
3178 return list; 3149 return list;
3179 } 3150 }
3180 3151
3181 DEFUN ("old-delq", Fold_delq, 2, 2, 0, /* 3152 DEFUN ("old-delq", Fold_delq, 2, 2, 0, /*
3182 Delete by side effect any occurrences of ELT as a member of LIST. 3153 Delete by side effect any occurrences of ELT as a member of LIST.
11786 DEFSUBR (Fold_rassq); 11757 DEFSUBR (Fold_rassq);
11787 11758
11788 DEFSUBR (Fposition); 11759 DEFSUBR (Fposition);
11789 DEFSUBR (Ffind); 11760 DEFSUBR (Ffind);
11790 11761
11791 DEFSUBR (Fdelete);
11792 DEFSUBR (Fold_delete); 11762 DEFSUBR (Fold_delete);
11793 DEFSUBR (Fdelq);
11794 DEFSUBR (Fold_delq); 11763 DEFSUBR (Fold_delq);
11795 DEFSUBR (FdeleteX); 11764 DEFSUBR (FdeleteX);
11796 DEFSUBR (FremoveX); 11765 DEFSUBR (FremoveX);
11797 DEFSUBR (Fremassoc); 11766 DEFSUBR (Fremassoc);
11798 DEFSUBR (Fremassq); 11767 DEFSUBR (Fremassq);