Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

input/output

2 views
Skip to first unread message

Kevin P Chugh

unread,
Mar 23, 1996, 3:00:00 AM3/23/96
to

hi - thanks to everyone who helped me with the function i needed -
can anyone tell me some standard input/output functions - i want to
get some keyboard input and i want to prompt the user for input -
finally, is there a way to concatenate two atoms - for example:

(myfunc 'a 'b) returns 'ab

thanks again for your help,
kevin

Erik Naggum

unread,
Mar 24, 1996, 3:00:00 AM3/24/96
to
[Kevin P Chugh]

| hi - thanks to everyone who helped me with the function i needed - can
| anyone tell me some standard input/output functions - i want to get
| some keyboard input and i want to prompt the user for input - finally,
| is there a way to concatenate two atoms - for example:
|
| (myfunc 'a 'b) returns 'ab

please consult your friendly Lisp manual, and look for ways to search the
help system. `apropos' is a useful command. also, you may find it useful
to browse the entire friendly Lisp manual to see what is available and
which names are used. applying `apropos' to "read" and "write" should
help. the Lisp manual should have a section on Input and Output.

as to your second question, the following will do what you say you want,
but you probably do not want what you say you want.

(intern (concatenate 'string (symbol-name 'a) (symbol-name 'b))) => AB
(intern (format nil "~A~A" 'a 'b)) => AB

BTW, functions do not return quoted symbols. the quote is there to prevent
the evaluator from evaluating the symbol.

(I have this recurring "homework feeling". please do not use the Net for
homework. your teachers are paid to help you, and you are supposed to
study on your own, anyway.)

#<Erik>
--
in my next life, I want to be my cat

Gerd Moellmann

unread,
Mar 24, 1996, 3:00:00 AM3/24/96
to
ch...@cs.buffalo.edu (Kevin P Chugh) writes:

> hi - thanks to everyone who helped me with the function i needed -
> can anyone tell me some standard input/output functions - i want to
> get some keyboard input and i want to prompt the user for input -
> finally, is there a way to concatenate two atoms - for example:
>
> (myfunc 'a 'b) returns 'ab
>

> thanks again for your help,
> kevin

In Allegro CL

(defun myfunc (first-symbol second-symbol)
(make-symbol (concatenate-strings first-symbol second-symbol)))

But why work with symbols instead of strings?
--
Gerd Moellmann, Altenbergstr. 6, D-40235 Duesseldorf, Germany
Software Development & Consulting
Internet: mm...@ibm.net / CIS: 100025,3303 / Phone: +49 211 666 881

Marco Antoniotti

unread,
Mar 26, 1996, 3:00:00 AM3/26/96
to
In article <mmannwx4...@ibm.net> mm...@ibm.net (Gerd Moellmann) writes:

From: mm...@ibm.net (Gerd Moellmann)
Newsgroups: comp.lang.lisp
Date: 24 Mar 1996 19:38:23 +0100
Organization: None
Path: agate!howland.reston.ans.net!newsjunkie.ans.net!newsfeeds.ans.net!news-m01.ny.us.ibm.net!hpxu!not-for-mail
Lines: 22
Sender: mm...@ibm.net
Distribution: world
References: <4j1ulq$k...@azure.acsu.buffalo.edu>
NNTP-Posting-Host: slip139-92-41-123.ut.nl.ibm.net
X-Newsreader: Gnus v5.1
X-NNTPDaemon: changi 0.9 for OS/2

ch...@cs.buffalo.edu (Kevin P Chugh) writes:

> hi - thanks to everyone who helped me with the function i needed -
> can anyone tell me some standard input/output functions - i want to
> get some keyboard input and i want to prompt the user for input -
> finally, is there a way to concatenate two atoms - for example:
>
> (myfunc 'a 'b) returns 'ab
>
> thanks again for your help,
> kevin

In Allegro CL

(defun myfunc (first-symbol second-symbol)
(make-symbol (concatenate-strings first-symbol second-symbol)))

But why work with symbols instead of strings?

Good point.

However a slightly better and more ANSI version is

(defun myfunc (s1 s2)
(declare (type symbol s1 s2))
(make-symbol (concatenate 'string
(symbol-name s1)
(symbol-name s2))))
--
Marco Antoniotti - Resistente Umano
===============================================================================
International Computer Science Institute | mar...@icsi.berkeley.edu
1947 Center STR, Suite 600 | tel. +1 (510) 643 9153
Berkeley, CA, 94704-1198, USA | +1 (510) 642 4274 x149
===============================================================================
...it is simplicity that is difficult to make.
...e` la semplicita` che e` difficile a farsi.
Bertholdt Brecht

dcwhite

unread,
Mar 27, 1996, 3:00:00 AM3/27/96
to
In article <30366608...@arcana.naggum.no>,
Erik Naggum <er...@naggum.no> wrote:
>[Kevin P Chugh]

>
>| hi - thanks to everyone who helped me with the function
i needed - can
>| anyone tell me some standard input/output functions - i
want to get
>| some keyboard input and i want to prompt the user for
input - finally,
>| is there a way to concatenate two atoms - for example:
>|
>| (myfunc 'a 'b) returns 'ab
>

Well said, regarding the issue of homework. If everyone got
their answers this way, there would be no "next generation"
to pass the "baton" to, and we would all lose a great deal of
expertise after the last "old-timer" passed on. Excuse the
allusions - hopefully everyone gets the point (it takes hard
work to develop expertise in any field).

dcw...@phoenix.net

0 new messages