# Fundamental data structures

## Linked lists

Linked lists are a fundamental data structure in Dusk. They are simply addresses
in memory each pointing to the next element, with the last element of the list
pointing to 0. The first field of a LL (linked list) element is always the
pointer field.

Iterating a LL is easy, it's as simple as reading next with @ ("llnext" makes
the intent clearer).

When you want to append a new element to the list, you can call "lladd", which
makes the list's last element point to "here". You can then write your new
element.

## Dictionary entry metadata

Each entry in the dictionary can have metadata linked to it in the form of a
linked list. The pointer to the first element (or 0 if none) for an entry is
given by the word "e>meta".

Each metadata element has this structure:

4b link to next
4b type ID
( any other type-specific data )

IDs below $100 are reserved for the system, IDs below $1000 are reserved for
Dusk OS, the rest is free to use. This is the list of used meta IDs:

$10  EMETA_8B        "code8b" code fragment
$11  EMETA_16B       "code16b" code fragment
$20  EMETA_DATAPTR   Link the the "data" portion of a word, used for namespaces
$21  EMETA_COMPILING ":compiling" code fragment

$100 EMETA_BOTHCONST See comp/c/sexpr.fs
$101 EMETA_CONSTOP   See comp/c/sexpr.fs
