I need to read and parse the following line from a character stream:
ORCL,11.840000,11.850000,11.850000,14A2EFF
that is: ticker symbol, bid, last, ask, volume
I'm also planning a multi-threaded program, so it is not clear to me
how to change the value of the special *read-base* to 16 (in order to
read the volume as 21638911). The Hyperspec says
file://localhost/usr/share/doc/HyperSpec/Body/s_let_l.htm
"...each binding is lexical unless there is a special declaration..."
How do I get a local *read-base* for this problem?
--
Everyman has three hearts;
one to show the world, one to show friends, and one only he knows.
From: Kent M Pitman
Subject: Re: *read-base* and multi-threaded
Date:
Message-ID: <usm1f51z2.fsf@nhplace.com>
GP lisper <········@CloudDancer.com> writes:
> I need to read and parse the following line from a character stream:
>
> ORCL,11.840000,11.850000,11.850000,14A2EFF
>
> that is: ticker symbol, bid, last, ask, volume
>
> I'm also planning a multi-threaded program, so it is not clear to me
> how to change the value of the special *read-base* to 16 (in order to
> read the volume as 21638911). The Hyperspec says
> file://localhost/usr/share/doc/HyperSpec/Body/s_let_l.htm
>
> "...each binding is lexical unless there is a special declaration..."
>
> How do I get a local *read-base* for this problem?
Don't confuse local with lexical.
(LET ((*READ-BASE* 16))
...)
Is there some reason that "dynamically local" is not sufficient?
Even a special binding will affect only the current process.
Some implementations have a LET-GLOBALLY which does affect other
processes, but it's VERY rare that you would need or want this.
On Sun, 24 Apr 2005 20:53:37 GMT, <······@nhplace.com> wrote:
> GP lisper <········@CloudDancer.com> writes:
>>
>> "...each binding is lexical unless there is a special declaration..."
>>
>> How do I get a local *read-base* for this problem?
>
> Don't confuse local with lexical.
>
> (LET ((*READ-BASE* 16))
> ...)
Thank you. Getting confirmation that LET will act as desired is what
I needed.
> Is there some reason that "dynamically local" is not sufficient?
No. What is insufficient is my knowledge of lisp.
--
Everyman has three hearts;
one to show the world, one to show friends, and one only he knows.