On Wed, 06 Oct 2010 04:14:37 +0400, bearophile <bearophileh...@lycos.com> wrote:

Denis Koroskin:

I found the following to work fine:

K[V] assocArray = createAssocArray();

K[V] createAssocArray()
{
     K[V] assocArray = [
        k1: v1,
        k2: v2,
        ...
     ];

     return assocArray;
}

Thank you for your answer. But I need to compute it, so I don't have just an AA literal. And I'd like it to be immutable :-)

Bye,
bearophile

Compute mutable copy and then cast to immutable. Am I missing something?

Reply via email to