This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: LispReader
- From: Per Bothner <per at bothner dot com>
- To: Nic Ferrier <nferrier at tapsellferrier dot co dot uk>
- Cc: kawa at sources dot redhat dot com
- Date: Wed, 20 Feb 2002 18:47:55 -0800
- Subject: Re: LispReader
- References: <87ofisum0u.fsf@tf1.tapsellferrier.co.uk>
Nic Ferrier wrote:
> I've discovered why LispReader was abstract (I think).
>
> LispReader.readObject() casts the port that created the LispReader to
> an InPort. Naturally if the port is not an InPort this fails.
>
> The LispReader takes a LineBufferedReader in it's constructor so stand
> alone the class fails to read object. The sub-classes (such as
> ScmRead) extend it so that the port is an InPort.
>
>
> I'll have a look and see if it's possible that LispReader might not
> have to rely on InPort.
It doesn't really. You can wrap the InPort stuff by
if (port instanceof InPort)
is is done various other places.
The InPort readState field is used to change the prompt string. A
cleaner solution would be to add a way to addociate proporties with
with a InPort or perhaps a LineBufferedReader, like we do for
Procedure.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/