> ## Documentation Index
> Fetch the complete documentation index at: https://docs.standardcomputers.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables and Types in the Standard Language Guide

> Learn how to declare variables, assign values, use Standard's built-in data types, initialize null variables, and avoid reserved words.

Variables are the foundation of any Standard program. In Standard, a variable name can be any alphanumeric value as long as it does not start with a number or a special character, and it may not contain a special character anywhere in the name. Variable names are case-sensitive, so `myName` and `myname` are treated as two distinct variables.

To set a variable to a value, write the variable name followed by whitespace and the value you want to assign:

```text theme={null}
pi 3.14159268
myName "John Snow"
```

## Types

Standard automatically infers and sets the type of a variable based on the value you assign. Once a type is established, the variable must maintain that type throughout its lifetime. The following built-in types are supported:

```text theme={null}
#Strings
fullname "John Jacobs"

#Doubles
e 2.71828

#Integers
quantity 1400

#Booleans
faded false

#Arrays
arr { 1, 2, 3 }
```

## Null Types and Initialization

You can set a variable to null by following the variable name with `null`. You can also declare a variable on its own line with no assigned value — Standard will automatically initialize it to null. The variable inherits a concrete type the first time you assign it a non-null value:

```text theme={null}
username
in username "What's your name?"
print username
```

In the example above, `username` starts as null, receives its type when the user provides input, and is then printed to the console.

## Reserved Words

Variable names may not be a reserved word or built-in function name. They also may not share a name with any function you define in your own Standard code. The following words are reserved and unavailable for use as variable names:

```text theme={null}
alert     break     clean     clear     delete    download
files     for       history   if        in        is
import    launch    map       out       print     registry
relay     reload    run       share     standards stds
tree      view      volume    while     window    $config
```

<Warning>
  Using a reserved word as a variable name will cause an error at runtime. Choose descriptive names that don't conflict with Standard's built-in vocabulary.
</Warning>
