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
reading string literals
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
 
Patrick Summers  
View profile  
 More options Oct 18 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: "Patrick Summers" <plsumm...@worldnet.att.net>
Date: 1999/10/18
Subject: reading string literals
Hello all,

I am new to LISP, but have still managed to write MOST of my phone list
homework assignment in it.  However, I am having one small problem:

I would like to have the user input a persons name, but have it treated as a
string literal.  When I use the code
(setq firstname (read)) and the user types: Bill
it returns BILL.

How can I read it in as "Bill" without the user typing the quotes?

I would like a simple Stringread function, which the version of Harlequin
LispWorks I'm using does have (I've seen in the list of errors when I make a
mistake), but I can't find any documentation on how to use it.

Thanks in advance,
Pat Summers


 
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.
Barry Margolin  
View profile  
 More options Oct 18 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Barry Margolin <bar...@bbnplanet.com>
Date: 1999/10/18
Subject: Re: reading string literals
In article <7ug0jd$qu...@bgtnsc03.worldnet.att.net>,

Patrick Summers <plsumm...@worldnet.att.net> wrote:
>Hello all,

>I am new to LISP, but have still managed to write MOST of my phone list
>homework assignment in it.  However, I am having one small problem:

>I would like to have the user input a persons name, but have it treated as a
>string literal.  When I use the code
>(setq firstname (read)) and the user types: Bill
>it returns BILL.

>How can I read it in as "Bill" without the user typing the quotes?

Try READ-LINE.  This will read a line of input as a string.

--
Barry Margolin, bar...@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


 
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 Oct 18 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1999/10/18
Subject: Re: reading string literals
* "Patrick Summers" <plsumm...@worldnet.att.net>
| I would like to have the user input a persons name, but have it treated
| as a string literal.  When I use the code (setq firstname (read)) and the
| user types: Bill it returns BILL.

  READ parses and returns Lisp expressions and data.

| How can I read it in as "Bill" without the user typing the quotes?

  well, the user obviously needs to terminate his input with something, and
  that something is typically a line terminator, too, which means that
  READ-LINE should seem like a fairly typical thing to think of.

| I would like a simple Stringread function, which the version of Harlequin
| LispWorks I'm using does have (I've seen in the list of errors when I make a
| mistake), but I can't find any documentation on how to use it.

  the problem with introspective environments is that people who have no
  idea what to look for tend to find the strangest things.  try a textbook
  and make sure you leave your old language backgrounds behind: try to
  grasp what the language is giving you, rather than insist on taking what
  you think it ought to have.

#:Erik


 
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.
Erann Gat  
View profile  
 More options Oct 18 1999, 3:00 am
Newsgroups: comp.lang.lisp
From: g...@jpl.nasa.gov (Erann Gat)
Date: 1999/10/18
Subject: Re: reading string literals
In article <7ug0jd$qu...@bgtnsc03.worldnet.att.net>, "Patrick Summers"

<plsumm...@worldnet.att.net> wrote:
> Hello all,

> I am new to LISP, but have still managed to write MOST of my phone list
> homework assignment in it.  However, I am having one small problem:

> I would like to have the user input a persons name, but have it treated as a
> string literal.  When I use the code
> (setq firstname (read)) and the user types: Bill
> it returns BILL.

> How can I read it in as "Bill" without the user typing the quotes?

Use READ-LINE.  (Or you can write your own reader function using
READ-CHAR.)

Erann Gat
g...@jpl.nasa.gov


 
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 »