Mercurial > hg > xemacs-beta
comparison src/fns.c @ 4966:48b63cd88a21
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 01 Feb 2010 14:11:36 -0600 |
parents | e813cf16c015 6bc1f3f6cf0d |
children | b46c89ccbed3 44d7bde26046 |
comparison
equal
deleted
inserted
replaced
4965:d79e9cc6aeca | 4966:48b63cd88a21 |
---|---|
2886 return 1; | 2886 return 1; |
2887 | 2887 |
2888 /* 2. If both numbers, compare with `='. */ | 2888 /* 2. If both numbers, compare with `='. */ |
2889 if (NUMBERP (obj1) && NUMBERP (obj2)) | 2889 if (NUMBERP (obj1) && NUMBERP (obj2)) |
2890 { | 2890 { |
2891 Lisp_Object args[2]; | 2891 return (0 == bytecode_arithcompare (obj1, obj2)); |
2892 args[0] = obj1; | |
2893 args[1] = obj2; | |
2894 return !NILP (Feqlsign (2, args)); | |
2895 } | 2892 } |
2896 | 2893 |
2897 /* 3. If characters, compare case-insensitively. */ | 2894 /* 3. If characters, compare case-insensitively. */ |
2898 if (CHARP (obj1) && CHARP (obj2)) | 2895 if (CHARP (obj1) && CHARP (obj2)) |
2899 return DOWNCASE (0, XCHAR (obj1)) == DOWNCASE (0, XCHAR (obj2)); | 2896 return CANONCASE (0, XCHAR (obj1)) == CANONCASE (0, XCHAR (obj2)); |
2900 | 2897 |
2901 /* 4. If arrays of different types, compare their lengths, and | 2898 /* 4. If arrays of different types, compare their lengths, and |
2902 then compare element-by-element. */ | 2899 then compare element-by-element. */ |
2903 { | 2900 { |
2904 enum array_type artype1, artype2; | 2901 enum array_type artype1, artype2; |
2907 if (artype1 != artype2 && artype1 && artype2) | 2904 if (artype1 != artype2 && artype1 && artype2) |
2908 { | 2905 { |
2909 EMACS_INT i; | 2906 EMACS_INT i; |
2910 EMACS_INT l1 = XINT (Flength (obj1)); | 2907 EMACS_INT l1 = XINT (Flength (obj1)); |
2911 EMACS_INT l2 = XINT (Flength (obj2)); | 2908 EMACS_INT l2 = XINT (Flength (obj2)); |
2912 /* Both arrays, but of different types */ | 2909 /* Both arrays, but of different lengths */ |
2913 if (l1 != l2) | 2910 if (l1 != l2) |
2914 return 0; | 2911 return 0; |
2915 for (i = 0; i < l1; i++) | 2912 for (i = 0; i < l1; i++) |
2916 if (!internal_equalp (Faref (obj1, make_int (i)), | 2913 if (!internal_equalp (Faref (obj1, make_int (i)), |
2917 Faref (obj2, make_int (i)), depth + 1)) | 2914 Faref (obj2, make_int (i)), depth + 1)) |