REBOL Programming/attempt

USAGE:Edit

ATTEMPT value 

DESCRIPTION:Edit

Tries to evaluate and returns result or NONE on error.

ATTEMPT is a function value.

ARGUMENTSEdit

  • value -- (Type: any)

(SPECIAL ATTRIBUTES)Edit

  • throw

SOURCE CODEEdit

attempt: func [
    {Tries to evaluate and returns result or NONE on error.} 
    [throw] 
    value
][
    unless error? set/any 'value try :value [get/any 'value]
]
Last modified on 27 October 2012, at 22:18