Correction, I posted a wrong version, so once again:

do http://www.rebolforces.com/~ladislav/highfun.r

    default2: transp-func [
        code [block!]
        fault [block!]
        /good pass [block!]
        /local result error code2
    ] [
        transp-while [not tail? code] [
            if error? set/any 'error try [
                code2: second do/next compose [
                    error? set/any 'result (code)
                ]
                code: skip code (index? code2) - 3
            ] [code: tail code]
        ]
        either error? get/any 'error [
            fault: func [[throw] error [error!]] fault
            fault error
        ] [
            do any [pass [local-return get/any 'result]]
        ]
    ]

block2: head insert copy [] try [first []]
default2/good [first block2 1] ["error"] ["pass"] ; == "pass"
default2/good [first block2] ["error"] ["pass"] ; == "pass"
default2/good [first []] ["error"] ["pass"] ; == "error"

Ciao
    Ladislav


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.



-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to