Mercurial > hg > xemacs-beta
comparison src/data.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | 3742ea8250b5 aa5ed11f473b |
children | 623d57b7fbe8 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
158 { | 158 { |
159 if (val < min || val > max) | 159 if (val < min || val > max) |
160 args_out_of_range_3 (make_int (val), make_int (min), make_int (max)); | 160 args_out_of_range_3 (make_int (val), make_int (min), make_int (max)); |
161 } | 161 } |
162 | 162 |
163 /* On some machines, XINT needs a temporary location. | |
164 Here it is, in case it is needed. */ | |
165 | |
166 EMACS_INT sign_extend_temp; | |
167 | |
168 /* On a few machines, XINT can only be done by calling this. */ | |
169 /* XEmacs: only used by m/convex.h */ | |
170 EMACS_INT sign_extend_lisp_int (EMACS_INT num); | |
171 EMACS_INT | |
172 sign_extend_lisp_int (EMACS_INT num) | |
173 { | |
174 if (num & (1L << (INT_VALBITS - 1))) | |
175 return num | ((-1L) << INT_VALBITS); | |
176 else | |
177 return num & (EMACS_INT) ((1UL << INT_VALBITS) - 1); | |
178 } | |
179 | |
180 | 163 |
181 /* Data type predicates */ | 164 /* Data type predicates */ |
182 | 165 |
183 DEFUN ("eq", Feq, 2, 2, 0, /* | 166 DEFUN ("eq", Feq, 2, 2, 0, /* |
184 Return t if the two args are the same Lisp object. | 167 Return t if the two args are the same Lisp object. |
214 return NILP (object) ? Qt : Qnil; | 197 return NILP (object) ? Qt : Qnil; |
215 } | 198 } |
216 | 199 |
217 DEFUN ("consp", Fconsp, 1, 1, 0, /* | 200 DEFUN ("consp", Fconsp, 1, 1, 0, /* |
218 Return t if OBJECT is a cons cell. `nil' is not a cons cell. | 201 Return t if OBJECT is a cons cell. `nil' is not a cons cell. |
202 | |
203 See the documentation for `cons' or the Lisp manual for more details on what | |
204 a cons cell is. | |
219 */ | 205 */ |
220 (object)) | 206 (object)) |
221 { | 207 { |
222 return CONSP (object) ? Qt : Qnil; | 208 return CONSP (object) ? Qt : Qnil; |
223 } | 209 } |
224 | 210 |
225 DEFUN ("atom", Fatom, 1, 1, 0, /* | 211 DEFUN ("atom", Fatom, 1, 1, 0, /* |
226 Return t if OBJECT is not a cons cell. `nil' is not a cons cell. | 212 Return t if OBJECT is not a cons cell. `nil' is not a cons cell. |
213 | |
214 See the documentation for `cons' or the Lisp manual for more details on what | |
215 a cons cell is. | |
227 */ | 216 */ |
228 (object)) | 217 (object)) |
229 { | 218 { |
230 return CONSP (object) ? Qnil : Qt; | 219 return CONSP (object) ? Qnil : Qt; |
231 } | 220 } |
232 | 221 |
233 DEFUN ("listp", Flistp, 1, 1, 0, /* | 222 DEFUN ("listp", Flistp, 1, 1, 0, /* |
234 Return t if OBJECT is a list. `nil' is a list. | 223 Return t if OBJECT is a list. `nil' is a list. |
224 | |
225 A list is either the Lisp object nil (a symbol), interpreted as the empty | |
226 list in this context, or a cons cell whose CDR refers to either nil or a | |
227 cons cell. A "proper list" contains no cycles. | |
235 */ | 228 */ |
236 (object)) | 229 (object)) |
237 { | 230 { |
238 return LISTP (object) ? Qt : Qnil; | 231 return LISTP (object) ? Qt : Qnil; |
239 } | 232 } |
254 return TRUE_LIST_P (object) ? Qt : Qnil; | 247 return TRUE_LIST_P (object) ? Qt : Qnil; |
255 } | 248 } |
256 | 249 |
257 DEFUN ("symbolp", Fsymbolp, 1, 1, 0, /* | 250 DEFUN ("symbolp", Fsymbolp, 1, 1, 0, /* |
258 Return t if OBJECT is a symbol. | 251 Return t if OBJECT is a symbol. |
252 | |
253 A symbol is a Lisp object with a name. It can optionally have any and all of | |
254 a value, a property list and an associated function. | |
259 */ | 255 */ |
260 (object)) | 256 (object)) |
261 { | 257 { |
262 return SYMBOLP (object) ? Qt : Qnil; | 258 return SYMBOLP (object) ? Qt : Qnil; |
263 } | 259 } |
598 | 594 |
599 | 595 |
600 /* Extract and set components of lists */ | 596 /* Extract and set components of lists */ |
601 | 597 |
602 DEFUN ("car", Fcar, 1, 1, 0, /* | 598 DEFUN ("car", Fcar, 1, 1, 0, /* |
603 Return the car of LIST. If arg is nil, return nil. | 599 Return the car of CONS. If CONS is nil, return nil. |
604 Error if arg is not nil and not a cons cell. See also `car-safe'. | 600 The car of a list or a dotted pair is its first element. |
605 */ | 601 |
606 (list)) | 602 Error if CONS is not nil and not a cons cell. See also `car-safe'. |
603 */ | |
604 (cons)) | |
607 { | 605 { |
608 while (1) | 606 while (1) |
609 { | 607 { |
610 if (CONSP (list)) | 608 if (CONSP (cons)) |
611 return XCAR (list); | 609 return XCAR (cons); |
612 else if (NILP (list)) | 610 else if (NILP (cons)) |
613 return Qnil; | 611 return Qnil; |
614 else | 612 else |
615 list = wrong_type_argument (Qlistp, list); | 613 cons = wrong_type_argument (Qlistp, cons); |
616 } | 614 } |
617 } | 615 } |
618 | 616 |
619 DEFUN ("car-safe", Fcar_safe, 1, 1, 0, /* | 617 DEFUN ("car-safe", Fcar_safe, 1, 1, 0, /* |
620 Return the car of OBJECT if it is a cons cell, or else nil. | 618 Return the car of OBJECT if it is a cons cell, or else nil. |
623 { | 621 { |
624 return CONSP (object) ? XCAR (object) : Qnil; | 622 return CONSP (object) ? XCAR (object) : Qnil; |
625 } | 623 } |
626 | 624 |
627 DEFUN ("cdr", Fcdr, 1, 1, 0, /* | 625 DEFUN ("cdr", Fcdr, 1, 1, 0, /* |
628 Return the cdr of LIST. If arg is nil, return nil. | 626 Return the cdr of CONS. If CONS is nil, return nil. |
627 The cdr of a list is the list without its first element. The cdr of a | |
628 dotted pair (A . B) is the second element, B. | |
629 | |
629 Error if arg is not nil and not a cons cell. See also `cdr-safe'. | 630 Error if arg is not nil and not a cons cell. See also `cdr-safe'. |
630 */ | 631 */ |
631 (list)) | 632 (cons)) |
632 { | 633 { |
633 while (1) | 634 while (1) |
634 { | 635 { |
635 if (CONSP (list)) | 636 if (CONSP (cons)) |
636 return XCDR (list); | 637 return XCDR (cons); |
637 else if (NILP (list)) | 638 else if (NILP (cons)) |
638 return Qnil; | 639 return Qnil; |
639 else | 640 else |
640 list = wrong_type_argument (Qlistp, list); | 641 cons = wrong_type_argument (Qlistp, cons); |
641 } | 642 } |
642 } | 643 } |
643 | 644 |
644 DEFUN ("cdr-safe", Fcdr_safe, 1, 1, 0, /* | 645 DEFUN ("cdr-safe", Fcdr_safe, 1, 1, 0, /* |
645 Return the cdr of OBJECT if it is a cons cell, else nil. | 646 Return the cdr of OBJECT if it is a cons cell, else nil. |
649 return CONSP (object) ? XCDR (object) : Qnil; | 650 return CONSP (object) ? XCDR (object) : Qnil; |
650 } | 651 } |
651 | 652 |
652 DEFUN ("setcar", Fsetcar, 2, 2, 0, /* | 653 DEFUN ("setcar", Fsetcar, 2, 2, 0, /* |
653 Set the car of CONS-CELL to be NEWCAR. Return NEWCAR. | 654 Set the car of CONS-CELL to be NEWCAR. Return NEWCAR. |
655 The car of a list or a dotted pair is its first element. | |
654 */ | 656 */ |
655 (cons_cell, newcar)) | 657 (cons_cell, newcar)) |
656 { | 658 { |
657 if (!CONSP (cons_cell)) | 659 if (!CONSP (cons_cell)) |
658 cons_cell = wrong_type_argument (Qconsp, cons_cell); | 660 cons_cell = wrong_type_argument (Qconsp, cons_cell); |
661 return newcar; | 663 return newcar; |
662 } | 664 } |
663 | 665 |
664 DEFUN ("setcdr", Fsetcdr, 2, 2, 0, /* | 666 DEFUN ("setcdr", Fsetcdr, 2, 2, 0, /* |
665 Set the cdr of CONS-CELL to be NEWCDR. Return NEWCDR. | 667 Set the cdr of CONS-CELL to be NEWCDR. Return NEWCDR. |
668 The cdr of a list is the list without its first element. The cdr of a | |
669 dotted pair (A . B) is the second element, B. | |
666 */ | 670 */ |
667 (cons_cell, newcdr)) | 671 (cons_cell, newcdr)) |
668 { | 672 { |
669 if (!CONSP (cons_cell)) | 673 if (!CONSP (cons_cell)) |
670 cons_cell = wrong_type_argument (Qconsp, cons_cell); | 674 cons_cell = wrong_type_argument (Qconsp, cons_cell); |
976 #endif /* WITH_NUMBER_TYPES */ | 980 #endif /* WITH_NUMBER_TYPES */ |
977 | 981 |
978 DEFUN ("=", Feqlsign, 1, MANY, 0, /* | 982 DEFUN ("=", Feqlsign, 1, MANY, 0, /* |
979 Return t if all the arguments are numerically equal. | 983 Return t if all the arguments are numerically equal. |
980 The arguments may be numbers, characters or markers. | 984 The arguments may be numbers, characters or markers. |
985 | |
986 arguments: (FIRST &rest ARGS) | |
981 */ | 987 */ |
982 (int nargs, Lisp_Object *args)) | 988 (int nargs, Lisp_Object *args)) |
983 { | 989 { |
984 ARITHCOMPARE_MANY (==, eql) | 990 ARITHCOMPARE_MANY (==, eql) |
985 } | 991 } |
986 | 992 |
987 DEFUN ("<", Flss, 1, MANY, 0, /* | 993 DEFUN ("<", Flss, 1, MANY, 0, /* |
988 Return t if the sequence of arguments is monotonically increasing. | 994 Return t if the sequence of arguments is monotonically increasing. |
989 The arguments may be numbers, characters or markers. | 995 |
996 (That is, if there is a second argument, it must be numerically greater than | |
997 the first. If there is a third, it must be numerically greater than the | |
998 second, and so on.) At least one argument is required. | |
999 | |
1000 The arguments may be numbers, characters or markers. | |
1001 | |
1002 arguments: (FIRST &rest ARGS) | |
990 */ | 1003 */ |
991 (int nargs, Lisp_Object *args)) | 1004 (int nargs, Lisp_Object *args)) |
992 { | 1005 { |
993 ARITHCOMPARE_MANY (<, lt) | 1006 ARITHCOMPARE_MANY (<, lt) |
994 } | 1007 } |
995 | 1008 |
996 DEFUN (">", Fgtr, 1, MANY, 0, /* | 1009 DEFUN (">", Fgtr, 1, MANY, 0, /* |
997 Return t if the sequence of arguments is monotonically decreasing. | 1010 Return t if the sequence of arguments is monotonically decreasing. |
1011 | |
1012 (That is, if there is a second argument, it must be numerically less than | |
1013 the first. If there is a third, it must be numerically less than the | |
1014 second, and so forth.) At least one argument is required. | |
1015 | |
998 The arguments may be numbers, characters or markers. | 1016 The arguments may be numbers, characters or markers. |
1017 | |
1018 arguments: (FIRST &rest ARGS) | |
999 */ | 1019 */ |
1000 (int nargs, Lisp_Object *args)) | 1020 (int nargs, Lisp_Object *args)) |
1001 { | 1021 { |
1002 ARITHCOMPARE_MANY (>, gt) | 1022 ARITHCOMPARE_MANY (>, gt) |
1003 } | 1023 } |
1004 | 1024 |
1005 DEFUN ("<=", Fleq, 1, MANY, 0, /* | 1025 DEFUN ("<=", Fleq, 1, MANY, 0, /* |
1006 Return t if the sequence of arguments is monotonically nondecreasing. | 1026 Return t if the sequence of arguments is monotonically nondecreasing. |
1007 The arguments may be numbers, characters or markers. | 1027 The arguments may be numbers, characters or markers. |
1028 | |
1029 arguments: (FIRST &rest ARGS) | |
1008 */ | 1030 */ |
1009 (int nargs, Lisp_Object *args)) | 1031 (int nargs, Lisp_Object *args)) |
1010 { | 1032 { |
1011 ARITHCOMPARE_MANY (<=, le) | 1033 ARITHCOMPARE_MANY (<=, le) |
1012 } | 1034 } |
1013 | 1035 |
1014 DEFUN (">=", Fgeq, 1, MANY, 0, /* | 1036 DEFUN (">=", Fgeq, 1, MANY, 0, /* |
1015 Return t if the sequence of arguments is monotonically nonincreasing. | 1037 Return t if the sequence of arguments is monotonically nonincreasing. |
1016 The arguments may be numbers, characters or markers. | 1038 The arguments may be numbers, characters or markers. |
1039 | |
1040 arguments: (FIRST &rest ARGS) | |
1017 */ | 1041 */ |
1018 (int nargs, Lisp_Object *args)) | 1042 (int nargs, Lisp_Object *args)) |
1019 { | 1043 { |
1020 ARITHCOMPARE_MANY (>=, ge) | 1044 ARITHCOMPARE_MANY (>=, ge) |
1021 } | 1045 } |
1027 complexity are higher, which means that those algorithms will run SLOWER | 1051 complexity are higher, which means that those algorithms will run SLOWER |
1028 than this one in the common case. Optimize the common case! */ | 1052 than this one in the common case. Optimize the common case! */ |
1029 DEFUN ("/=", Fneq, 1, MANY, 0, /* | 1053 DEFUN ("/=", Fneq, 1, MANY, 0, /* |
1030 Return t if no two arguments are numerically equal. | 1054 Return t if no two arguments are numerically equal. |
1031 The arguments may be numbers, characters or markers. | 1055 The arguments may be numbers, characters or markers. |
1056 | |
1057 arguments: (FIRST &rest ARGS) | |
1032 */ | 1058 */ |
1033 (int nargs, Lisp_Object *args)) | 1059 (int nargs, Lisp_Object *args)) |
1034 { | 1060 { |
1035 #ifdef WITH_NUMBER_TYPES | 1061 #ifdef WITH_NUMBER_TYPES |
1036 REGISTER int i, j; | 1062 REGISTER int i, j; |
1407 | 1433 |
1408 | 1434 |
1409 DEFUN ("+", Fplus, 0, MANY, 0, /* | 1435 DEFUN ("+", Fplus, 0, MANY, 0, /* |
1410 Return sum of any number of arguments. | 1436 Return sum of any number of arguments. |
1411 The arguments should all be numbers, characters or markers. | 1437 The arguments should all be numbers, characters or markers. |
1438 | |
1439 arguments: (&rest ARGS) | |
1412 */ | 1440 */ |
1413 (int nargs, Lisp_Object *args)) | 1441 (int nargs, Lisp_Object *args)) |
1414 { | 1442 { |
1415 #ifdef WITH_NUMBER_TYPES | 1443 #ifdef WITH_NUMBER_TYPES |
1416 REGISTER int i; | 1444 REGISTER int i; |
1479 | 1507 |
1480 DEFUN ("-", Fminus, 1, MANY, 0, /* | 1508 DEFUN ("-", Fminus, 1, MANY, 0, /* |
1481 Negate number or subtract numbers, characters or markers. | 1509 Negate number or subtract numbers, characters or markers. |
1482 With one arg, negates it. With more than one arg, | 1510 With one arg, negates it. With more than one arg, |
1483 subtracts all but the first from the first. | 1511 subtracts all but the first from the first. |
1512 | |
1513 arguments: (FIRST &rest ARGS) | |
1484 */ | 1514 */ |
1485 (int nargs, Lisp_Object *args)) | 1515 (int nargs, Lisp_Object *args)) |
1486 { | 1516 { |
1487 #ifdef WITH_NUMBER_TYPES | 1517 #ifdef WITH_NUMBER_TYPES |
1488 REGISTER int i; | 1518 REGISTER int i; |
1601 } | 1631 } |
1602 | 1632 |
1603 DEFUN ("*", Ftimes, 0, MANY, 0, /* | 1633 DEFUN ("*", Ftimes, 0, MANY, 0, /* |
1604 Return product of any number of arguments. | 1634 Return product of any number of arguments. |
1605 The arguments should all be numbers, characters or markers. | 1635 The arguments should all be numbers, characters or markers. |
1636 | |
1637 arguments: (&rest ARGS) | |
1606 */ | 1638 */ |
1607 (int nargs, Lisp_Object *args)) | 1639 (int nargs, Lisp_Object *args)) |
1608 { | 1640 { |
1609 #ifdef WITH_NUMBER_TYPES | 1641 #ifdef WITH_NUMBER_TYPES |
1610 REGISTER int i; | 1642 REGISTER int i; |
1673 DEFUN ("div", Fdiv, 1, MANY, 0, /* | 1705 DEFUN ("div", Fdiv, 1, MANY, 0, /* |
1674 Same as `/', but dividing integers creates a ratio instead of truncating. | 1706 Same as `/', but dividing integers creates a ratio instead of truncating. |
1675 Note that this is a departure from Common Lisp, where / creates ratios when | 1707 Note that this is a departure from Common Lisp, where / creates ratios when |
1676 dividing integers. Having a separate function lets us avoid breaking existing | 1708 dividing integers. Having a separate function lets us avoid breaking existing |
1677 Emacs Lisp code that expects / to do integer division. | 1709 Emacs Lisp code that expects / to do integer division. |
1710 | |
1711 arguments: (FIRST &rest ARGS) | |
1678 */ | 1712 */ |
1679 (int nargs, Lisp_Object *args)) | 1713 (int nargs, Lisp_Object *args)) |
1680 { | 1714 { |
1681 REGISTER int i; | 1715 REGISTER int i; |
1682 Lisp_Object accum, divisor; | 1716 Lisp_Object accum, divisor; |
1737 return Qnil; /* not (usually) reached */ | 1771 return Qnil; /* not (usually) reached */ |
1738 } | 1772 } |
1739 #endif /* HAVE_RATIO */ | 1773 #endif /* HAVE_RATIO */ |
1740 | 1774 |
1741 DEFUN ("/", Fquo, 1, MANY, 0, /* | 1775 DEFUN ("/", Fquo, 1, MANY, 0, /* |
1742 Return first argument divided by all the remaining arguments. | 1776 Return FIRST divided by all the remaining arguments. |
1743 The arguments must be numbers, characters or markers. | 1777 The arguments must be numbers, characters or markers. |
1744 With one argument, reciprocates the argument. | 1778 With one argument, reciprocates the argument. |
1779 | |
1780 arguments: (FIRST &rest ARGS) | |
1745 */ | 1781 */ |
1746 (int nargs, Lisp_Object *args)) | 1782 (int nargs, Lisp_Object *args)) |
1747 { | 1783 { |
1748 #ifdef WITH_NUMBER_TYPES | 1784 #ifdef WITH_NUMBER_TYPES |
1749 REGISTER int i; | 1785 REGISTER int i; |
1859 DEFUN ("max", Fmax, 1, MANY, 0, /* | 1895 DEFUN ("max", Fmax, 1, MANY, 0, /* |
1860 Return largest of all the arguments. | 1896 Return largest of all the arguments. |
1861 All arguments must be real numbers, characters or markers. | 1897 All arguments must be real numbers, characters or markers. |
1862 The value is always a number; markers and characters are converted | 1898 The value is always a number; markers and characters are converted |
1863 to numbers. | 1899 to numbers. |
1900 | |
1901 arguments: (FIRST &rest ARGS) | |
1864 */ | 1902 */ |
1865 (int nargs, Lisp_Object *args)) | 1903 (int nargs, Lisp_Object *args)) |
1866 { | 1904 { |
1867 #ifdef WITH_NUMBER_TYPES | 1905 #ifdef WITH_NUMBER_TYPES |
1868 REGISTER int i, maxindex = 0; | 1906 REGISTER int i, maxindex = 0; |
1954 DEFUN ("min", Fmin, 1, MANY, 0, /* | 1992 DEFUN ("min", Fmin, 1, MANY, 0, /* |
1955 Return smallest of all the arguments. | 1993 Return smallest of all the arguments. |
1956 All arguments must be numbers, characters or markers. | 1994 All arguments must be numbers, characters or markers. |
1957 The value is always a number; markers and characters are converted | 1995 The value is always a number; markers and characters are converted |
1958 to numbers. | 1996 to numbers. |
1997 | |
1998 arguments: (FIRST &rest ARGS) | |
1959 */ | 1999 */ |
1960 (int nargs, Lisp_Object *args)) | 2000 (int nargs, Lisp_Object *args)) |
1961 { | 2001 { |
1962 #ifdef WITH_NUMBER_TYPES | 2002 #ifdef WITH_NUMBER_TYPES |
1963 REGISTER int i, minindex = 0; | 2003 REGISTER int i, minindex = 0; |
2047 } | 2087 } |
2048 | 2088 |
2049 DEFUN ("logand", Flogand, 0, MANY, 0, /* | 2089 DEFUN ("logand", Flogand, 0, MANY, 0, /* |
2050 Return bitwise-and of all the arguments. | 2090 Return bitwise-and of all the arguments. |
2051 Arguments may be integers, or markers or characters converted to integers. | 2091 Arguments may be integers, or markers or characters converted to integers. |
2092 | |
2093 arguments: (&rest ARGS) | |
2052 */ | 2094 */ |
2053 (int nargs, Lisp_Object *args)) | 2095 (int nargs, Lisp_Object *args)) |
2054 { | 2096 { |
2055 #ifdef HAVE_BIGNUM | 2097 #ifdef HAVE_BIGNUM |
2056 REGISTER int i; | 2098 REGISTER int i; |
2097 } | 2139 } |
2098 | 2140 |
2099 DEFUN ("logior", Flogior, 0, MANY, 0, /* | 2141 DEFUN ("logior", Flogior, 0, MANY, 0, /* |
2100 Return bitwise-or of all the arguments. | 2142 Return bitwise-or of all the arguments. |
2101 Arguments may be integers, or markers or characters converted to integers. | 2143 Arguments may be integers, or markers or characters converted to integers. |
2144 | |
2145 arguments: (&rest ARGS) | |
2102 */ | 2146 */ |
2103 (int nargs, Lisp_Object *args)) | 2147 (int nargs, Lisp_Object *args)) |
2104 { | 2148 { |
2105 #ifdef HAVE_BIGNUM | 2149 #ifdef HAVE_BIGNUM |
2106 REGISTER int i; | 2150 REGISTER int i; |
2147 } | 2191 } |
2148 | 2192 |
2149 DEFUN ("logxor", Flogxor, 0, MANY, 0, /* | 2193 DEFUN ("logxor", Flogxor, 0, MANY, 0, /* |
2150 Return bitwise-exclusive-or of all the arguments. | 2194 Return bitwise-exclusive-or of all the arguments. |
2151 Arguments may be integers, or markers or characters converted to integers. | 2195 Arguments may be integers, or markers or characters converted to integers. |
2196 | |
2197 arguments: (&rest ARGS) | |
2152 */ | 2198 */ |
2153 (int nargs, Lisp_Object *args)) | 2199 (int nargs, Lisp_Object *args)) |
2154 { | 2200 { |
2155 #ifdef HAVE_BIGNUM | 2201 #ifdef HAVE_BIGNUM |
2156 REGISTER int i; | 2202 REGISTER int i; |
2591 { XD_LO_LINK, offsetof (struct weak_list, next_weak), | 2637 { XD_LO_LINK, offsetof (struct weak_list, next_weak), |
2592 0, { 0 }, XD_FLAG_NO_KKCC }, | 2638 0, { 0 }, XD_FLAG_NO_KKCC }, |
2593 { XD_END } | 2639 { XD_END } |
2594 }; | 2640 }; |
2595 | 2641 |
2596 DEFINE_LISP_OBJECT ("weak-list", weak_list, | 2642 DEFINE_DUMPABLE_LISP_OBJECT ("weak-list", weak_list, |
2597 mark_weak_list, print_weak_list, | 2643 mark_weak_list, print_weak_list, |
2598 0, weak_list_equal, weak_list_hash, | 2644 0, weak_list_equal, weak_list_hash, |
2599 weak_list_description, | 2645 weak_list_description, |
2600 struct weak_list); | 2646 struct weak_list); |
2601 /* | 2647 /* |
2602 -- we do not mark the list elements (either the elements themselves | 2648 -- we do not mark the list elements (either the elements themselves |
2603 or the cons cells that hold them) in the normal marking phase. | 2649 or the cons cells that hold them) in the normal marking phase. |
2604 -- at the end of marking, we go through all weak lists that are | 2650 -- at the end of marking, we go through all weak lists that are |
2605 marked, and mark the cons cells that hold all marked | 2651 marked, and mark the cons cells that hold all marked |
3059 static const struct memory_description weak_box_description[] = { | 3105 static const struct memory_description weak_box_description[] = { |
3060 { XD_LO_LINK, offsetof (struct weak_box, value) }, | 3106 { XD_LO_LINK, offsetof (struct weak_box, value) }, |
3061 { XD_END} | 3107 { XD_END} |
3062 }; | 3108 }; |
3063 | 3109 |
3064 DEFINE_NONDUMPABLE_LISP_OBJECT ("weak-box", weak_box, mark_weak_box, | 3110 DEFINE_NODUMP_LISP_OBJECT ("weak-box", weak_box, mark_weak_box, |
3065 print_weak_box, 0, weak_box_equal, | 3111 print_weak_box, 0, weak_box_equal, |
3066 weak_box_hash, weak_box_description, | 3112 weak_box_hash, weak_box_description, |
3067 struct weak_box); | 3113 struct weak_box); |
3068 | 3114 |
3069 DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /* | 3115 DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /* |
3297 { XD_LISP_OBJECT, offsetof(struct ephemeron, value), | 3343 { XD_LISP_OBJECT, offsetof(struct ephemeron, value), |
3298 0, { 0 }, XD_FLAG_NO_KKCC }, | 3344 0, { 0 }, XD_FLAG_NO_KKCC }, |
3299 { XD_END } | 3345 { XD_END } |
3300 }; | 3346 }; |
3301 | 3347 |
3302 DEFINE_NONDUMPABLE_LISP_OBJECT ("ephemeron", ephemeron, | 3348 DEFINE_NODUMP_LISP_OBJECT ("ephemeron", ephemeron, |
3303 mark_ephemeron, print_ephemeron, | 3349 mark_ephemeron, print_ephemeron, |
3304 0, ephemeron_equal, ephemeron_hash, | 3350 0, ephemeron_equal, ephemeron_hash, |
3305 ephemeron_description, | 3351 ephemeron_description, |
3306 struct ephemeron); | 3352 struct ephemeron); |
3307 | 3353 |