From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.esat.net!nslave.kpnqwest.net!nloc2.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Read a line from a file, turn into a list of numbers References: <56ea2da4.0203280327.5a152717@posting.google.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3226320120828579@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 21 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 28 Mar 2002 16:01:46 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader1.kpnqwest.net 1017331306 193.71.199.50 (Thu, 28 Mar 2002 17:01:46 MET) NNTP-Posting-Date: Thu, 28 Mar 2002 17:01:46 MET Xref: archiver1.google.com comp.lang.lisp:30420 * wild_donkey@yahoo.com (David) | I'm trying to learn lisp and am struggling a bit over doing this | seemingly simple task. I want to read a line from a file and convert it | into a list of numbers. So far I have only managed to convert it into a | list of characters and can't figure out how to get a list of numbers (the | numbers are separated by spaces in the file) from this. Can anyone point | me in the right function direction. In addition to Nils's suggestions, look into the reader variable *read-default-float-format* if you have floating-point numbers. Also, please note that when you use the general reader, any symbol with a syntax error relative to the Common Lisp syntax, will be returned as a symbol. It might be a good idea to set up your own readtable to exclude irrelevant data types, too. Unfortunately, there is no standard way to avoid interning new symbols. (I wish there were at least some way to control the reader's willingness to make symbols.) /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.