Ernest,
I'm not sure what you're saying,
For my version, if the file contains:
A B (followed by return)
D E (followed by return)
then the following sequence of calls will return values as indicated:
(read) => A
(read) => B
(readline) => "D E"
Is the missing "" line what all the fuss is about from CLIPS
programmers??
or, from the console, if you type
A B (without hitting return)
(read) => A
(readline) => <waits for newline>
Seems like my version would return A for the (read), and hang waiting
for you to type the return, just like CLIPS. If on the other hand, you
type
A B (followed by a return)
(read) => A
(readline) => " B"
The (read) returns the 'A', and the (readline) returns immediately
(since the return is still in the input queue). Isn't this the desired
action??
-----Original Message-----
From: Ernest Friedman-Hill [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 25, 1998 13:13
To: [EMAIL PROTECTED]
Subject: Re: JESS: read followed by readline
Hi Michael,
This is how Jess behaved for all (read)s prior to version 4.1. The
problem here is that this -isn't- how CLIPS behaves for files, and
I've had a number of complaints from folks porting CLIPS file-handling
code. I'd like to maintain compatibility in this area; in general I've
tried to make Jess commands work as much like their CLIPS counterparts
as possible to make people's lives easier. Old versions of Jess
behaved correctly for the console, and incorrectly for files;
apparently the current version is misbehaving for certain combinations
of console calls, but the file handling is perfect.
In CLIPS, if you have the following file
A B
D E
then the following sequence of calls will return values as indicated:
(read) => A
(read) => B
(readline) => ""
(readline) => "D E"
on the other hand, from the console, if a (read) is issued and you
type
A B
the read will return 'A'. If a (readline) is then issued it will hang
until you type a newline.
I think I'm going to go with my earlier suggestion, that of internally
keeping track of two different kinds of routers: console-like ones and
other ones. It's the only way to get these two different behaviours.
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------