logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: About iterators and enums: msg#00129

Subject: Re: About iterators and enums
On Wed, 28 Apr 2004, Bardur Arantsson wrote:

> 1) This would require Enum to know about internals of
> other data structures

Really?
Give me examples. Hashtbl does not work anyway because at least one step
is not in constant time unless you modify the representation of hash
tables to fit into the enum model.
By the way, PMap.enum works in O(n) too.

> -- which would mean that they would
> have to be exported! Not a good idea.

Enum is a client of other data structures.
Without other data structures Enum is useless, not list neither arrays.

> 2) It would be cumbersome to extend Enum for user-defined
> data structures. You would have to do what has been done
> with ExtHashtbl, etc. for _every_ new ADT, and even then
> you would have conflicts if two developers were to release
> ADTs for which they had written such "wrappers".

If well-designed abstract data types are abstract and do not provide
iterators, it is exactly because iterators are impossible, meaningless or
simply unsafe?


Martin



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click


<Prev in Thread] Current Thread [Next in Thread>