[REBOL] Re: comments for beginner ugly code ;-)
From: antonr:lexicon at: 17-Mar-2005 22:18
Hmm.. If you needed to do that several times within the
repend block, then I would make a nice function to help.
DEFAULT was somebody else's idea, I think it went
something like this:
default: func [
code [block!] fault [block!]
/local err
][
either error? set/any 'err try code fault [err]
]
Examples:
default [join "apples" "pears"]["no good"]
;== "applespears"
default [join "apples" "pears" / 0]["no good"]
;== "no good"
repend result [
default [
read aDirectory/:fileName/:chapter-info
][
join "Couldn't read: " copy/part fileName back tail fileName
]
...
]
Anton.