Lisp HUG Maillist Archive

read-delimited-list

Hi there!:)

I had a bit of a trouble with read-delimited-list function. It is supposed  
to read a bunch of values followed by some endline character after which  
it returns a list of the values.

For example

CL-USER 219 > (read-delimited-list #\;)
1 2 3;
(1 2 3)

which if fine.

But when you try to use #\Newline character it just won't work. After  
entering your values and pressing enter a few times you have to break out.

Any ideas?


Re: read-delimited-list

Hello Yury,

This works:

CL-USER 38 > (defvar *my-readtable* (copy-readtable nil))
*MY-READTABLE*

CL-USER 39 > (set-syntax-from-char #\Newline #\) *my-readtable*)
T

CL-USER 40 > (let ((*readtable* *my-readtable*))
    (read-delimited-list #\Newline))
1 2 3
(1 2 3)

Found this solution from
http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/5a001baba7e2fb/6e2a4ba4f14a6196?lnk=gst&q=read+delimited+list#6e2a4ba4f14a6196
(There is also a longer description)

Cheers,
Lauri


On 11/2/07, Yury Davidouski <dcu-stuff@list.ru> wrote:
>
> Hi there!:)
>
> I had a bit of a trouble with read-delimited-list function. It is supposed
> to read a bunch of values followed by some endline character after which
> it returns a list of the values.
>
> For example
>
> CL-USER 219 > (read-delimited-list #\;)
> 1 2 3;
> (1 2 3)
>
> which if fine.
>
> But when you try to use #\Newline character it just won't work. After
> entering your values and pressing enter a few times you have to break out.
>
> Any ideas?
>
>


Updated at: 2020-12-10 08:45 UTC