gzz-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gzz] 15th, 16th (jvk)


From: Antti-Juhani Kaijanaho
Subject: Re: [Gzz] 15th, 16th (jvk)
Date: Mon, 19 Aug 2002 14:34:29 +0300
User-agent: Mutt/1.4i

On 20020819T132426+0300, Janne Kujala wrote:
> I decided to not use an iterator for getVarNames, because
>       - an array can be sorted inside the Debug library
>         if the internals are changed (e.g., to use a hash)

I don't understand.  Iterators are an internals-neutral interface.

(If you need to have a sorted container, then a balanced tree is a
better choice than a hash table.)

Well, if it is not used frequently, I guess it wouldn't matter.

>       - an iterator interface would require lots of extra code
>         (unless the internals are directly exposed)

Most of the time you can just export the iterator of the underlying
container (this does not mean exposing the internals directly).  The
only situation where you'd get hairy code is when the mapping from the
internal sequence (as given by the underlying container's iterator) to
the returned sequence is nontrivial.

-- 
Antti-Juhani Kaijanaho, LuK (BSc)    * http://www.iki.fi/gaia/ * address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]