Subject: Re: HELP : How to make number a list?
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1997/09/23
Newsgroups: comp.lang.scheme
Message-ID: <607lbe$7ivcn@fido.asd.sgi.com>

<dvandeun@vub.ac.be> wrote:
+---------------
| : 	Ex.  2345 ----> '(2 3 4 5)
| 
| Use (map string->number (string->list (number->string ...))) but it's 
| quite an insane thing to do.
+---------------

Cute, but doesn't *quite* work:

    > (map string->number (string->list (number->string 12345)))
    string->number: expects type <string> as 1st arg; given #\1

You need one more level of insane indirection:  ;-}  ;-}

    > (map string->number (map string (string->list (number->string 12345))))
    (1 2 3 4 5)


-Rob

-----
Rob Warnock, 7L-551		rpw3@sgi.com   http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA