Default

angerangel edited this page Jan 3, 2013 · 1 revision

Table of Contents

USAGE

  DEFAULT 'word value

DESCRIPTION

Set a word to a default value if it hasn't been set yet. DEFAULT is a function value.

ARGUMENTS

  • word -- The word (use :var for word! values) (word! set-word! lit-word!)
  • value -- The value

SOURCE

default: make function! [  [
    {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"
][
    unless all [value? word not none? get word] [set word :value] :value
] ] 
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.