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

Q: concatenate two strings

12 views
Skip to first unread message

Takashi Ishihara

unread,
May 19, 2000, 3:00:00 AM5/19/00
to

Hi,
is there any way to make a symbol or string to have a suffix,
say inpt = a, output = -a. or input = "a", output = "-a". TIA.

t

David Hanley

unread,
May 19, 2000, 3:00:00 AM5/19/00
to
I dunno, looks a lot like homework!

Look at the functions "concatenate" and "intern"

these should get you started.

dave


Barry Margolin

unread,
May 20, 2000, 3:00:00 AM5/20/00
to
In article <8g593g$nfi$1...@mark.ucdavis.edu>,
Takashi Ishihara <lit...@logan.ucdavis.edu> wrote:

>David Hanley <d...@ncgr.org> wrote:
>> I dunno, looks a lot like homework!
>
>Exactry.
>I'm doing TA.
>The requirement is to simplify a list of arithmetic ops + numbers.
>No variable (symbols) in the test file, but one of students really
>wants to know if it's possible to simplify variables.

>
>> Look at the functions "concatenate" and "intern"
>
>> these should get you started.
>
>I already checked these. They're not helpful AFAIK.
>If anybody knows a nice trick to concatenate strings or symbols, please
>let me know. TIA.

(concatenate 'string "-" (string string-or-symbol))

The STRING function will coerce a symbol into a string, and return a string
unchanged.

--
Barry Margolin, bar...@genuity.net
Genuity, 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.

Takashi Ishihara

unread,
May 20, 2000, 3:00:00 AM5/20/00
to
David Hanley <d...@ncgr.org> wrote:
> I dunno, looks a lot like homework!

Exactry.
I'm doing TA.
The requirement is to simplify a list of arithmetic ops + numbers.
No variable (symbols) in the test file, but one of students really
wants to know if it's possible to simplify variables.

> Look at the functions "concatenate" and "intern"

> these should get you started.

I already checked these. They're not helpful AFAIK.
If anybody knows a nice trick to concatenate strings or symbols, please
let me know. TIA.

t

Thomas A. Russ

unread,
May 22, 2000, 3:00:00 AM5/22/00
to

Strings:

(concatenate 'string ...)

Symbols:

(intern (concatenate 'string (string symbol) ...))

you might want to get fancier with packages, though.

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

0 new messages