We can create variables using
    :=
    which both declares new variables and assigns values to them. The variable name goes on the left and the value goes on the right, e.g.
  
x := 42
  Variables in Ra have some differences from other programming languages. One of the main ones is that we can create relation variables (relvars), e.g.
planet := {planet_name:str,  orbit_period:float, gravity:float}{
          ["Mercury",        88,                 0.38],
          ["Venus",          224.7,              0.91],
          ["Earth",          365.25,             1.00],
          ["Mars",           687,                0.38],
          ["Jupiter",        4331,               2.36],
          ["Saturn",         10747,              0.92],
          ["Uranus",         30589,              0.89],
          ["Neptune",        59800,              1.12],
}
    planet
    ┌─────────────┬──────────────┬─────────┐ │ planet_name │ orbit_period │ gravity │ ├─────────────┼──────────────┼─────────┤ │ Earth │ 365.25 │ 1.00 │ │ Jupiter │ 4331.00 │ 2.36 │ │ Mars │ 687.00 │ 0.38 │ │ Mercury │ 88.00 │ 0.38 │ │ Neptune │ 59800.00 │ 1.12 │ │ Saturn │ 10747.00 │ 0.92 │ │ Uranus │ 30589.00 │ 0.89 │ │ Venus │ 224.70 │ 0.91 │ └─────────────┴──────────────┴─────────┘
And we can then use these variables in relation expressions (ignore the new syntax for now, it will be explained soon), e.g.
planet[orbit_period < 500]{planet_name}
    ┌─────────────┐ │ planet_name │ ├─────────────┤ │ Earth │ │ Mercury │ │ Venus │ └─────────────┘
Note: in Ra there is no nil, NULL or undefined: variables are given a value whenever they are created.
Heading
We can use heading(frame) to return the heading for the current scope, i.e. each local variable.
  
heading(frame)
  | attr | type | 
|---|---|
| x | int | 
| planet | {planet_name:str,orbit_period:float,gravity:float} |