Maity, Ashis K wrote:
...
Changing the topic now, is there a way to save a Space that has failed?
We want to store the values of that Space that has failed? Is that
possible? In the code snippet below, we could store the values of the
Space when it has succeeded or had alternatives. But can not do the same
thing when it has failed? What we can do so that we store the values
before it decides that it would fail? Am I able to state my problem? ...
As far as I know, all information within a space is lost as soon as it
fails.
Needing that information might suggest a problem with your design
because in a failed space, the data has become inconsistent and invalid.
That said, there is a way to send data out from a space shortly before
it fails. Just use try-catch around your computation and send the data
to a port:
declare
Stream
P = {NewPort Stream}
S = {Space.new
proc {$ R}
try
R = 3
R = R+1
catch E then
{Port.send P R}
raise E end
end
end}
in
case {Space.ask S}
of failed then
{Browse Stream.1}
end
Cheers,
Wolfgang
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users