updating oE PUT

Map (Hash Table)

A map is a special array, often called an associative array or dictionary; in a map the data values (any Euphoria object) are indexed by keys (also any Euphoria object).

When programming think in terms of key:value pairs. For example we can code things like this:

   custrec = new() -- Create a new map 
   put(custrec, "Name", "Joe Blow") 
   put(custrec, "Address", "555 High Street") 
   put(custrec, "Phone", 555675632) 

This creates three elements in the map, and they are indexed by "Name", "Address" and "Phone", meaning that to get the data associated with those keys we can code:

   object data = get(custrec, "Phone") 
   -- data now set to 555675632 

Note that only one instance of a given key can exist in a given map, meaning for example, we could not have two separate "Name" values in the above custrec map.

Maps automatically grow to accommodate all the elements placed into it.

Associative arrays can be implemented in many different ways, depending on what efficiency trade-offs have been made. This implementation allows you to specify how many items you expect the map to hold, or simply start with the default size.

As the number of items in the map grows, the map may increase its size to accommodate larger numbers of items.

Operation Codes for Put


include map.e 
namespace map 
public enum PUT 
Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu