|REBOL 3 Docs||Guide||Concepts||Functions||Datatypes||Errors|
|TOC < Back Next >||Updated: 17-Aug-2010 Edit History|
Set a word to a default value if it hasn't been set yet.
word [word! set-word! lit-word!] - The word (use :var for word! values)
value - The value
The default function is a clear way to indicate that you want a variable set to a default value if it's not already been set.
default size 100
would set size to 100 if it's not already been set to some other value.
size: any [size 100]
However, default avoids the need to specify the size word twice and also makes the intention of your code more clear. It's quite often used for global configuration variables that may or may not have been set by prior code.
|TOC < Back Next >||REBOL.com - WIP Wiki||Feedback Admin|