You can declare a mapping one of two ways.

mapping m;

m = ([ ]);

-or-

m = allocate_mapping(int size); // allocate_mapping(20);

--

Mappings are obviously accessed by a key, which can be any
primitive data type. You do not have to first add the key.
You simply start referencing it.

example:

m["dogs"] = "woof woof";

write(m["dogs"]); -> "woof woof";
write(m["cats"]); -> 0  /* there is no "cats" key defined yet */

--

Mappings also use operations like normal primitive data types.

m["dogs"] += " bow wow";

write(m["dogs"]); -> "woof woof bow wow";

--

Some efuns/sfuns:

SYNOPSIS
        mixed *m_indices(mapping map)

DESCRIPTION
        Return an array containing the indices of mapping 'map'.       
        
        
SYNOPSIS
        int mappingp(mixed arg)

DESCRIPTION
        Return 1 if the argument is a mapping, or 0 if it is not. 

        
SYNOPSIS
        mapping reconstruct_mapping(mixed *arr)
        
DESCRIPTION
        Return a mapping from an array in format:
         ({key1,value1,key2,value2,key3,value3...})
        Used for restoring a mapping after restore_object()
        [all mappings are static in LPMud 2.4.5-DR]

      
SYNOPSIS
        mixed * deconstruct_mapping(mapping m)
        
DESCRIPTION
        Return an array from a mapping:
         ({key1,value1,key2,value2,key3,value3...})
        Used for saving a mapping prior to save_object()
        [all mappings are static in LPMud 2.4.5-DR]
        

SYNOPSIS
        mixed * m_values(mapping m)
        
DESCRIPTION
        See m_indices() .. only this returns the values, not the keys
        of a mapping.
        

SYNOPSIS
        int member(mixed arg, mixed element)
        
DESCRIPTION
        This fun works for both arrays and mappings.
        For mappings, 
        returns 1 if element is present in data collection "arg",
        0 if not.
        For arrays,
        simulates member_array().
        
SYNOPSIS
        mixed get_key(mapping map, mixed val)
        
DESCRIPTION

        Retrieves the first key in the mapping
        found for value "val".
        

 