Indexing access for Lists and Maps considered harmful?

Brendon McLean java.net at twistedprotein.com
Tue Jun 23 15:29:24 PDT 2009


On 23 Jun 2009, at 20:29, Joshua Bloch wrote:

> I think it's *critical* that the behavior be defined to match the  
> "expected"
> behavior.  These *must* function identically:
>
>   myArray[i] = myArray[j] = val;
>
>   myList[i] = myList[j] = val;
>
> When extending a language, it's critical to enable reasoning by  
> analogy; to
> do otherwise *will* cause bugs and ill-will.  (See this 20-year-old  
> paper
> for my take on the topic:
> http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=37945 .)

100% agree here.  Array/list equivalence is logical, expected and  
intuitive.  Surely the point of the syntactic sugar to make this so?

Brendon McLean.



More information about the coin-dev mailing list