
On 16 February 2005 14:30, John Goerzen wrote:
On Wed, Feb 16, 2005 at 07:31:07AM +0100, Tomasz Zielonka wrote:
verbatim. Any ideas?
I have never used table_io. maybe there's a bug in it. Hmmm, it seems to be conceptually wrong. The single purpose of table_io seems to be to avoid keeping the result of an IO action in the log. But how is WASH going to recreate it when it's needed again as in your example?
Ahh, I think I understand what you're saying... table_io is not supposed to be unsafe; that is, it should work without saving data in the log even if the input would be different on a different session. But yes, if the validation fails, there would be no way to do that save re-reading the input.
It sounds like, in my case, unsafe_io would be better. My input should never change across a single session.
The next question is this: the I/O really only needs to be done once. Once the user has selected an item, that's enough. If my understanding is correct, on each subsequent screen in my application, Wash will follow through the entire call history, and will run the I/O again even if not needed. Is that correct? Or does the unsafe_io prevent that?
You can avoid lots of unnecessary state-saving by judicious use of WASH's 'once' function. eg. ... r <- once ( ... lots of IO ... ) ... will save the value of r in the log, and not repeat the entire inner action each time the script is run. In fact, it might be helpful to note that io = once . unsafe_io Cheers, Simon

On Wed, Feb 16, 2005 at 02:56:11PM -0000, Simon Marlow wrote:
the unsafe_io prevent that?
You can avoid lots of unnecessary state-saving by judicious use of WASH's 'once' function. eg.
Hmm. I have tried this, but I'm not seeing any change in the amount of saved state as a result of using once. For instance, I have a selection screen. People can select things there, then go off and do things. At various points, the user could realize they made the wrong selection, so I call the selection screen again. However, even though I have once $ standardQuery $ ... in the selection screen, all that state is saved... I don't think I can use forever there either, because I'm using that trick (which does seem to work) to enable returning to a yet earlier page. Maybe I'm missing what once does. Thanks again for your help. -- John
participants (2)
-
John Goerzen
-
Simon Marlow