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

Just for fun (NULL of NULL is identity)



That "despicable" behaviour of NULL on the SUN when compiled,
namely that (NULL (NULL 'FOO)) returns FOO instead of T,
could have been obtained interpreted too if something like this
had been done:

(SETQ G*NON-NULL-VALUE 'T) ;Initial value

(DEFUN MY-NULL (LL)
  (COND (LL (PROGN (SETQ G*NON-NULL-VALUE LL)
		   'NIL))
	(T G*NON-NULL-VALUE)))

Does CLtL explicitly forbid this? I don't think so. It defines "true"
as anything not NIL, and says NULL is "true" if it argument is ().
But it *does* say that (null x) is the same as (eq x '()), so
presumably if you hack NULL then EQ must be hacked too, and
also typep.
-------