REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 18-Feb-2009 Edit History  

REBOL 3 Concepts: Tour: Variables

Pending Revision

This document was written for R2 and has yet to be revised for R3.

OLD DOCS

This section is obsolete and being replaced. It is kept only as a source for new content.

Words can be used as variables that refer to values. To define a word as a variable, follow the word with a colon (:), then the value to which the variable refers as shown in the following examples:.

age: 22
snack-time: 12:32
birthday: 20-Mar-1997
friends: ["John" "Paula" "Georgia"]

A variable can refer to any type of value, including functions (see [bad-link:concepts/functions.txt]) and objects (see objects).

A variable refers to a specific value only within a defined context, such as a block, a function, or an entire program. Outside that context the variable can refer to some other value or to no value at all. The context of a variable can span an entire program or it can be restricted to a particular block, function, or object. In other languages, the context of a variable is often referred to as the scope of a variable.


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin