:target DEFAULT 'branch :look


Set word or path to a default value if it is not set yet or blank.

RETURNS: [ any-value!]

Former value or branch result, can only be null if no target


:target [ set-word! set-path!]
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
:look [<...>]
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

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 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:]
uri: any [uri]
Last Updated: 1/18/2020, 9:40:26 PM