> For the complete documentation index, see [llms.txt](https://rogerlevy.gitbook.io/ramen/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rogerlevy.gitbook.io/ramen/docs-1/structs.md).

# Data Structures

Ramen makes use of a simple "struct" facility. Used for structs that are passed on the stack. (Objects don't use these words.)

To declare a struct say `struct <name>`

`sfield ( struct bytes valtype -- <name> ) ( adr -- adr+n )` defines a struct field.

`svar ( struct valtype -- <name> )` is short for `struct cell 0 sfield`.

Valtype is obsolete and not used so you can set it to anything.

`sizeof` gets the size of a struct.

## Example:

```
struct color
    color 0 svar color.r
    color 0 svar color.g
    color 0 svar color.b
    color 0 svar color.a
```
