Subject: Re: list->string question
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/10/23
Newsgroups: comp.lang.scheme
Message-ID: <7ur0ga$6orje@fido.engr.sgi.com>
Frederic -Deelight- Jacquot <mailto.deelight@poulet.org> wrote:
+---------------
| Dirk van Deun <dvandeun@vub.ac.be> wrote:
| > You must map a symbol->string operation over the list...
| 
| Thank you very much, it works :)
| 
| (define list2string
| (lambda (list)
| (if (= (length list) 1)
| (symbol->string (car list))
| (string-append (symbol->string (car list)) " " (list2string (cdr list)))
| )))
+---------------

And just in case you don't already use a text editor that indents
Lisp/Scheme properly, please try to find one (or do it manually).
It will make your programs *so* much more readable to others:

    (define list2string
      (lambda (list)
	(if (= (length list) 1)
	  (symbol->string (car list))
	  (string-append (symbol->string (car list))
			 " "
			 (list2string (cdr list))))))

[Yes, I know, some people prefer all three args of an "if" to be
indented the same. But I don't.]


-Rob

-----
Rob Warnock, 8L-846		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA