Subject: Re: How To make '(--a) equals 'a
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 2000/04/14
Newsgroups: comp.lang.lisp
Message-ID: <8d69a5$3etse$1@fido.engr.sgi.com>
David  <tiand8@cs.man.ac.uk> wrote:
+---------------
| make "not not a" (ie. '(--a) ) equals "a"; where "a" is any atom in Lisp.
+---------------

If what you *really* meant to say was:

	to make "(not (not a))" equal "a", where "a" is any atom in Lisp

then that is not possible, because in Lisp it simply isn't true!!
In Lisp, the "not" operator maps everything to a boolean value,
which throws away information which is significant in equality
comparisons. Repeating the "not" operator cannot undo that loss
of information, since it's gone, gone, gone...

	> (equalp 123 (not (not 123)))
	==> NIL
	> 123
	==> 123
	> (not 123)
	==> NIL
	> (not (not 123))
	==> T
	>

Likewise:

	> (equalp 'a (not (not 'a)))
	==> NIL
	> 'a
	==> A
	> (not 'a)
	==> NIL
	> (not (not 'a))
	==> T
	> 

And further:

	> (defvar a 'bcd)
	==> A
	> (equalp a (not (not a)))
	==> NIL
	> a
	==> BCD
	> (not a)
	==> NIL
	> (not (not a))
	==> T
	>

+---------------
| This is trivial in Maths
+---------------

Wrong. It is neither trivial nor correct. Remember, you said
``where "a" is *ANY* atom in Lisp'' [emphasis added], not just
boolean-valued expressions (boolean atoms, variables currently
holding boolean values, etc.).

Only if you restrict yourself to boolean-valued expressions does
what you're attempting make any sense.


-Rob

-----
Rob Warnock, 41L-955		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043