[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Of growing code and diminishing hacks...



(define (overloaded-cdr val)
	(if (null? val) nil (cdr val)))

(overloaded-cdr (assq key a-list))


	In other words, if you want a cdr that horribly overloads nil, then
write one.  As for me, I think of a cons cell as an object with car and
cdr fields in it, just as a point is an object with x and y fields in
it.  How about:

(define (overloaded-x point)
	(if (null? point) nil (x point)))