Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Character conversion !!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Olivier Pinçon  
View profile  
 More options Jul 27 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: "Olivier Pinçon" <opin...@wanadoo.fr>
Date: 1999/07/27
Subject: Character conversion !!
Hi everybody !!

How can I transform single characters (like 'A, 'B, 'C) in strings which
contain 1 character (respectively "A", "B", "C") ?

Please tell it me !! It should'nt be complicated !!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jul 27 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/07/27
Subject: Re: Character conversion !!
* "Olivier Pinçon" <opin...@wanadoo.fr>
| How can I transform single characters (like 'A, 'B, 'C) in strings which
| contain 1 character (respectively "A", "B", "C") ?
|
| Please tell it me !! It should'nt be complicated !!

  'A, 'B, and 'C aren't characters, they are (quoted) symbols.

  if you want a mapping from string to symbol, it's INTERN (creates it) or
  FIND-SYMBOL (looks it up, only).  if you want a mapping from symbol to
  string, it's SYMBOL-NAME.

  #\A, #\B, and #\C are characters.  if you have a string of length one or
  a symbol whose symbol-name is a string of length one, CHARACTER will
  return the corresponding character.

  (character 'a) => #\A

  if you want to create a string out of a character, STRING will do that:

  (string #\a) => "a"

  which textbook or reference manual are you using?

  [I have assumed Common Lisp in the absence of any contrary information.]

#:Erik
--
  suppose we blasted all politicians into space.
  would the SETI project find even one of them?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Carroll  
View profile  
 More options Jul 27 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Mark Carroll <ma...@chiark.greenend.org.uk>
Date: 1999/07/27
Subject: Character conversion !!
In article <7njrun$2n...@wanadoo.fr>,

Olivier Pinçon <opin...@wanadoo.fr> wrote:
>Hi everybody !!

>How can I transform single characters (like 'A, 'B, 'C) in strings which
>contain 1 character (respectively "A", "B", "C") ?

>Please tell it me !! It should'nt be complicated !!

You may want symbol-name:

EC(1): (symbol-name 'a)
"A"
EC(2):

I'm not sure I completely understand you, though.

-- Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas A. Russ  
View profile  
 More options Jul 27 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 1999/07/27
Subject: Re: Character conversion !!

"Olivier Pinçon" <opin...@wanadoo.fr> writes:

> Hi everybody !!

> How can I transform single characters (like 'A, 'B, 'C) in strings which
> contain 1 character (respectively "A", "B", "C") ?

Just to be pedantic, the objects 'A, 'B, 'C, etc. are not CHARACTERs,
but rather SYMBOLs.  Common Lisp has a separate CHARACTER type which
would be written as #\A, #\B, #\C, etc.

> Please tell it me !! It should'nt be complicated !!

As another poster revealed, calling SYMBOL-NAME on a symbol will return
the name of that symbol as a string.  This, of course, works on symbols
with arbitrary length names.

A more interesting question is why do you want to do this?  Often
questions like yours mask other, more interesting and fundamental
questions about how to accomplish a particular task.

--
Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »