/doc/efun/mkmapping


SYNOPSIS

mapping mkmapping(mixed *arr1, mixed *arr2,...)

DESCRIPTION

Return a mapping with indices from 'arr1' and values from 'arr2'... . arr1[0] will index arr2...[0], arr1[1] will index arr2...[1], etc. If the arrays are of unequal size, the mapping will only contain as much elements as are in the smallest array.

Normally, mappings are extended by simply inserting new elements. This function is useful if you can estimate the needed size of the mapping in advance, to reduce the malloc overhead. Any unused allocated space will be freed after the current function returns.

EXAMPLE

	mkmapping( ({ 1, 2 }), ({ 10, 11 }), ({ 20, 21, 22}))
returns ([ 1:10;20, 2:11;21 ])

SEE ALSO

mappings
mappingp
m_indices
m_values
m_delete
m_sizeof

| Home | Applied | Concepts | Efuns | Help | Intro | Lib | LPC | Prop | Obj | Sefuns | Std | W |

Nightfall@quest.tat.physik.uni-tuebingen.de
Automatically generated on Don, 11. Apr 1996