:target DEFAULT 'branch :look
Set word or path to a default value if it is not set yet or blank.
DEFAULT is an ACTION!
Former value or branch result, can only be null if no target
Word or path which might be set--no target always branches
'branch [block! action! quoted!]
If target not set already, this is evaluated and stored there
Variadic lookahead used to make sure at end if no target
/only Consider target being BLANK! to be a value not to overwrite
uri: default http://www.rebol.com
But if you're evaluating something, it needs to be in a block i.e. if it's not a literal like the URL above
OSX64-latest: default [obj/name]
default looks to its left to see if the set-word uri: has a value or not. If not, it then evaluates the block on the right and assigns the value to uri. The original rebol3 behaviour was default uri http://www.rebol.com which was less clear that an assignment was occuring. One of the intended purposes was to setup some default values for a config file.
Alternate ways of doing the same thing:
if blank? uri [uri: http://www.rebol.com] uri: any [uri http://www.rebol.com]