From: lquan
Subject: who to use lisp language operate string ?
Date: 
Message-ID: <f4a95d61.0112292159.6c737325@posting.google.com>
I am just learning lisp . I even don't know how to merge several
string to a singal string . the problem is like follows :


  (define aa "I")
  (define bb "student")

  then I want to make a string result like "I am student" use aa and
bb.

  If you can help me.
  Thank you very much.

From: Thomas F. Burdick
Subject: Re: who to use lisp language operate string ?
Date: 
Message-ID: <xcvr8pd2oco.fsf@apocalypse.OCF.Berkeley.EDU>
·····@jfsys.com (lquan) writes:

> I am just learning lisp . I even don't know how to merge several
> string to a singal string . the problem is like follows :
> 
> 
>   (define aa "I")
>   (define bb "student")
> 
>   then I want to make a string result like "I am student" use aa and
> bb.

This took me about 5 minutes and should get you most of the way there:

  (defvar list ())
  
  (defmacro define (quote list)
    (list (quote push) (list (quote cons) (list (quote quote) quote) list) (quote list)))
  
  (defun do-someone-elses-homework (&key (in list))
    (loop with with = (make-array 0 :element-type 'character :adjustable t :fill-pointer 0)
          for (for . in) in in
          for = = 11 then (1- (floor = 10))
          for not = nil then (not not)
          do (loop for in across (reverse in)
                   do (vector-push-extend in with))
             (vector-push-extend #\Space with)
             (vector-push-extend (code-char (+ (char-code (aref (symbol-name for) 0)) =))
                                 with)
          when not do (let ((let (- (length with) (+ 2 (length in)))))
                         (setf (subseq with let)
                               (reverse (subseq with let))))
          finally (return (reverse with))))
  
  (define aa "I")
  (define bb "student")
  (do-someone-elses-homework)

>   If you can help me.
>   Thank you very much.

Okay, but seriously, it looks like you're trying to get help with your
homework in Scheme.  (1) You should say exactly what your homework is;
(2) you should ask on a scheme newsgroup (say, comp.lang.scheme), not
a Lisp one.

In Common Lisp, the functions CONCATENATE and FORMAT would probably be
of interest to you.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Christopher Stacy
Subject: Re: who to use lisp language operate string ?
Date: 
Message-ID: <usn9tf7r9.fsf@spacy.Boston.MA.US>
>>>>> On 29 Dec 2001 21:59:56 -0800, lquan  ("lquan") writes:
 lquan> I am just learning lisp . I even don't know how to merge several
 lquan> string to a singal string . the problem is like follows :
 lquan>   (define aa "I")
 lquan>   (define bb "student")
 lquan>   then I want to make a string result like "I am student" use aa and bb.

The code you have written above looks like it is in a language
called Scheme, which is a dialect of Lisp.  (Some people make the
argument that it's not really Lisp at all, but I'm not interested
in having that debate at the moment.)

The comp.lang.lisp newsgroup is primarily concerned with the dialect
of Lisp called "ANSI Common Lisp", which is very different from Scheme.
You will have better luck asking your question in comp.lang.scheme.

The function you are looking for is named "string-append".

This is a remarkably simple question.  For questions like this, it
will be faster for you to look up the answer in the manual for the
Scheme you are using, and you should also obtain a textbook.