Raven Manual - Variables

Variable names start with a $ sign to distinguish them from functions, but there is no rule to enforce this if one is really good at keeping track of name clashes, or prefers other prefixes. However, attempting to create a variable with the same name as a core function will throw an error.

The word as ( i - ) takes one item from the stack, and makes it a named variable within the current variable scope. If a variable of that name already exists, it is overwritten.

# Integers 
1 as $number 
 
# Strings 
'hello world' as $string 

The word is ( i - ) takes one item from the stack, and assigns it to the first existing variable found of that name. Is is not limited to the current variable scope.

Integers are passed by value directly on the stack exactly like a Forth engine. Other data types are passed by reference. The word copy ( item -- item-copy ) creates a copy of an item.

Get Firefox!