Hi  Ladislav

Thanks

I will try to set up a test with your  version of throw.

AR

Ladislav Mecir wrote:

>Anton Reisacher napsal(a):
>
>  
>
>>How safe is catch?
>>      
>>I have some rebol applications serving message communication (around 1000 to
>>2000 messages per day mostly) running for more than half a year on
>>Windows2000 Server without interruption since the last update of the OS for
>>security reasons.
>>
>>Recently I had to add some message splitting:
>>one-message -->  [message-part-1 message-part-2 message-part-3]
>>
>>
>>    
>>

>>Now I saw two crashes in one day.
>>I was somehow able to reproduce the crash 
>>"Invalid data type during recycle" 
>>by playing again the history of one to two weeks. But the crash happened
>>always processing another message.
>>
>>As I had seen in the past instable behaviour with constructs like this
>>foreach ... [
>>      catch [
>>              ..
>>              data: any [
>>                      a
>>                      b
>>                      throw
>>              ]
>>              ..
>>              ..
>>      ]
>>]
>>
>>I replaced the inner catch with statements like this
>>              if not other-tests [
>>                      deliver message
>>              ] 
>>and the crash went away.
>>
>>Now I am curious if someone else encountered the same behaviour too?
>>
>> 
>>
>>    
>>
>hi Anton, I needed a slightly different Catch version than the 
>"official" one. Try this to see if things go better:
>
>Rebol [
>    Title: "Catch"
>    File: %catch.r
>    Date: 4/Mar/2005/17:12
>    Author: "Ladislav Mecir"
>    Purpose: {
>        Catches local throw'
>        Ignores non-local throws
>        Works with Parse
>    }
>]
>
>    ; Evaluation of the following global functions is an error
>    return': func [[catch]] [throw make error! [throw not-local]]
>    exit': func [[catch]] [throw make error! [throw not-local]]
>    throw': func [[catch]] [throw make error! [throw not-local]]
>   
>    ; Error definition
>    system/error/throw: make system/error/throw [
>        not-local: "Global return', exit' or throw' evaluated"
>    ]
>
>    catch': func [
>        {Catches a throw' from a block and returns the value.}
>        block [block!] "Block to evaluate"
>        /local throw' result1 result2 result1?
>    ] [
>        ; "localize" 'throw' in the block
>        set [throw' block] use [throw'] reduce [
>            reduce ['throw' copy/deep block]
>        ]
>        set throw' func [value [any-type!]] [
>            error? set/any 'result1 get/any 'value
>            result1?: true
>            make error! ""
>        ]
>        either error? set/any 'result2 try block [
>            either result1? [return get/any 'result1] [result2]
>        ] [return get/any 'result2]
>    ]
>
>comment [
>    ; Usage:
>    catch' [parse "ssss" [(throw' "OK")]]
>]
>
>-L
>  
>


-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to