comparison src/data.c @ 3355:721daee0fcd8

[xemacs-hg @ 2006-04-23 20:12:25 by aidan] Take on board feedback from Stephen on my last changes.
author aidan
date Sun, 23 Apr 2006 20:12:31 +0000
parents 29234c1a76c7
children 80cd90837ac5
comparison
equal deleted inserted replaced
3354:15fb91e3a115 3355:721daee0fcd8
215 } 215 }
216 216
217 DEFUN ("consp", Fconsp, 1, 1, 0, /* 217 DEFUN ("consp", Fconsp, 1, 1, 0, /*
218 Return t if OBJECT is a cons cell. `nil' is not a cons cell. 218 Return t if OBJECT is a cons cell. `nil' is not a cons cell.
219 219
220 A cons cell is a Lisp object (an area in memory) comprising two pointers 220 See the documentation for `cons' or the Lisp manual for more details on what
221 called the CAR and the CDR. Each of these pointers can point to any other 221 a cons cell is.
222 Lisp object. The common Lisp data type, the list, is a specially-structured
223 series of cons cells.
224 */ 222 */
225 (object)) 223 (object))
226 { 224 {
227 return CONSP (object) ? Qt : Qnil; 225 return CONSP (object) ? Qt : Qnil;
228 } 226 }
229 227
230 DEFUN ("atom", Fatom, 1, 1, 0, /* 228 DEFUN ("atom", Fatom, 1, 1, 0, /*
231 Return t if OBJECT is not a cons cell. `nil' is not a cons cell. 229 Return t if OBJECT is not a cons cell. `nil' is not a cons cell.
230
231 See the documentation for `cons' or the Lisp manual for more details on what
232 a cons cell is.
232 */ 233 */
233 (object)) 234 (object))
234 { 235 {
235 return CONSP (object) ? Qnil : Qt; 236 return CONSP (object) ? Qnil : Qt;
236 } 237 }
237 238
238 DEFUN ("listp", Flistp, 1, 1, 0, /* 239 DEFUN ("listp", Flistp, 1, 1, 0, /*
239 Return t if OBJECT is a list. `nil' is a list. 240 Return t if OBJECT is a list. `nil' is a list.
240 241
241 A list is implemented as a series of cons cells structured such that the CDR 242 A list is either the Lisp object nil (a symbol), interpreted as the empty
242 of each cell either points to another cons cell or to `nil', the special 243 list in this context, or a cons cell whose CDR refers to either nil or a
243 Lisp value for both Boolean false and the empty list. 244 cons cell. A "proper list" contains no cycles.
244 */ 245 */
245 (object)) 246 (object))
246 { 247 {
247 return LISTP (object) ? Qt : Qnil; 248 return LISTP (object) ? Qt : Qnil;
248 } 249 }