Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!swrinde!cs.utexas.edu!asuvax!ennews!enuxsa.eas.asu.edu!shoeb
From: shoeb@enuxsa.eas.asu.edu (Shoeb A.  Bhinderwala)
Subject: Need help on lisp code..
Distribution: usa
Message-ID: <CzE0n4.3wF@ennews.eas.asu.edu>
Nntp-Posting-Host: enuxsa.eas.asu.edu
Sender: news@ennews.eas.asu.edu (USENET News System)
Organization: Arizona State University, Tempe, AZ
Date: Thu, 17 Nov 1994 01:11:27 GMT
Lines: 29

Hi,

I am new to lisp. In the following code i am trying to read a word 
from a text file and print it. But the 'concatenate' function
doesn't seem to work. At the end of 'concatenate' when i examine the
value of word it is "". Any help would be highly appreciated.

Thanks in advance.

(defun xx ()
	(with-open-file (word-stream "snow" :direction :input)
		(print (get-word word-stream))
	)
)

(defun get-word (word-stream)
	(do ( (ch "")
		  (word "")
		 )
		((string-equal ch " ") word)
		(setf ch (make-string 1 :initial-element (read-char word-stream nil)))
		(print ch)
		(concatenate 'string word ch )
		(print word)
	)
)

==========================================================
==========================================================
