From: Afzal Upal
Subject: Help!
Date: 
Message-ID: <5c3a8u$mf3@scapa.cs.ualberta.ca>
Hi:

I'm working in a package in kcl and I need to add character ? to a list
so I use cons to do it i.e., I have something like this

(cons '? list)

but what I actually end up having in the list is <package>?
i.e., with package-name concatenated to the character ?
Is there any way around this?

thanks,

Afzal

From: Thomas A. Russ
Subject: Re: Help!
Date: 
Message-ID: <ymizpy2mu3d.fsf@hobbes.isi.edu>
In article <··········@scapa.cs.ualberta.ca> ····@cs.ualberta.ca (Afzal Upal) writes:

 > 
 > I'm working in a package in kcl and I need to add character ? to a list
 > so I use cons to do it i.e., I have something like this
 > 
 > (cons '? list)

The quotation (') means that ? is a symbol with name "?" in the current
package where this code fragment was read.  That is the symbol that is
being consed onto the front of the list.  Call this package P1

It is important to remember that in Lisp, symbols are built-in objects
of a type that is distinct from string or character.

 > but what I actually end up having in the list is <package>?
 > i.e., with package-name concatenated to the character ?
 > Is there any way around this?

What you end up with in the list is the symbol '? from your package P1.
When the printer prints the value of that list in a different package,
the printer will include the package prefix so that the lisp reader will
be able to find the appropriate symbol '?, namely the one in package
P1.

If you wish to have this printing suppressed, then you need to use a
different print function (such as PRINC or the format ~A directive).

Other solutions may be forthcoming if you reveal to us what it is you
are trying to accomplish on a more global level.

-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu    
From: Rob Warnock
Subject: Re: Help!
Date: 
Message-ID: <5c4b0b$gd@tokyo.engr.sgi.com>
Afzal Upal <····@cs.ualberta.ca> wrote:
+---------------
| I'm working in a package in kcl and I need to add character ? to a list
| so I use cons to do it i.e., I have something like this
|	(cons '? list)
| but what I actually end up having in the list is <package>?
| i.e., with package-name concatenated to the character ?
+---------------

As others have pointed out, what you're cons'ing into the list is
a symbol (which comes with a package name), not a character at all.
Try this:

	(cons #\? list)


-Rob

-----
Rob Warnock, 7L-551		····@sgi.com
Silicon Graphics, Inc.		http://reality.sgi.com/rpw3/
2011 N. Shoreline Blvd.		Phone: 415-933-1673  FAX: 415-933-0979
Mountain View, CA  94043	PP-ASEL-IA
From: Rainer Joswig
Subject: Re: Help!
Date: 
Message-ID: <joswig-ya023180002301970747590001@news.lavielle.com>
In article <··········@scapa.cs.ualberta.ca>, ····@cs.ualberta.ca (Afzal
Upal) wrote:

> Hi:
> 
> I'm working in a package in kcl and I need to add character ? to a list
> so I use cons to do it i.e., I have something like this
> 
> (cons '? list)

'? is not a character. It denotes a symbol.
Go back and read the chapter about characters
in, for example, ANSI Common Lisp from Paul Graham.

You could use #\? .

Rainer Joswig

-- 
http://www.lavielle.com/~joswig/