Re: [Lush-users] how to interpret a string as lisp source?

[email protected]
Newsgroups gmane.lisp.lush.devel
Message-ID <[email protected]>
Quoting Leon Bottou <[email protected]>:

> On Friday 25 November 2005 09:21 pm, Ralf Juengling wrote:
> > Thanks. I ended up modifying function 'read'.
> > It's a small hack but it seems to do the trick:
>
> I just commited something like this into CVS.
> Instead of adding an argument to (read)
> I chose to
> to
>
>  (reading-string "(1 2 3)"
>    (read) )
>
> Somehow it is cleaner to handle this
> as a special case of an input stream
> because it handles end-of-files, and
> other errors gracefully..

Thanks. I also like this solution better.

I would actually go one step further and change the behavior of
function 'reading' so that it behaves like 'reading-string' when
the 1st argument is a string. It would be natural to generalize
function 'reading' again, should than become necessary (e.g.,
you might want to read from byte storage).

Ralf



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.