From: Bill Heiser
Subject: very elementary question (using the quote char in text)
Date: 
Message-ID: <1991Feb2.181752.23438@unixland.uucp>
This is extremely elementary, but the book I'm using doesn't seem
to describe it, at least not in any indexed reference...

How, in Vax Common Lisp, do I use the quote (') character in something
like the following?

(cond ((< value 21) '(value's less than 21)))

Lisp prints out something like "valueQUOTEs less than 21.  I'm sure
there must be some way to escape this char. I tried \, #\, etc.  I also
tried putting "'s around the whole string, which worked, except it
caused the "'s to be printed too.

Thanks for helping a total NOVICE!

-- 
home:	...!{uunet,bloom-beacon,esegue}!world!unixland!bill
	····@unixland.uucp    Public Access Unix - Esix SYSVR3
508-655-3848(12/24)  508-651-8723(12/24/96-HST)  508-651-8733(12/24/96-PEP-V32)
other:	······@world.std.com
From: Barry Margolin
Subject: Re: very elementary question (using the quote char in text)
Date: 
Message-ID: <1991Feb2.233332.22038@Think.COM>
In article <·····················@unixland.uucp> ····@unixland.uucp (Bill Heiser) writes:
>How, in Vax Common Lisp, do I use the quote (') character in something
>like the following?
>
>(cond ((< value 21) '(value's less than 21)))
>
>Lisp prints out something like "valueQUOTEs less than 21.  I'm sure
>there must be some way to escape this char. I tried \, #\, etc.  I also
>tried putting "'s around the whole string, which worked, except it
>caused the "'s to be printed too.

Try:

(cond ((< value 21) (format t "~&Value's less than 21~%")))

In other words, when you want to produce human-readable output, use an
output function, don't rely on Lisp's automatic printing.  As you've
discovered, the automatic printing normally outputs using the same syntax
as you have to use to enter the data, so it leaves the quotes in.

You could have used \ to escape the quote, e.g.

'(value\'s less than 21)

However, this would either print out as

(VALUE\'S LESS THAN 21)

or

(|VALUE'S| LESS THAN 21)

Neither of these is very nice looking.  The purpose of the automatic
printing is to let you look at *data*, usually while debugging.  It is not
a good subsitute for a user interface.
--
Barry Margolin, Thinking Machines Corp.

······@think.com
{uunet,harvard}!think!barmar