[E-Lang] An Attempted Restatement of Hydro's Semantics

Ralph Hartley hartley@aic.nrl.navy.mil
Tue, 03 Apr 2001 16:35:10 -0400


Tyler Close wrote:

> At 11:42 AM 4/3/01 -0700, Marc Stiegler wrote:
> 
>>  > Thinking about the last time I used indexes in Java:
>>  >
>>  > You have two lists {"Mark","Mark","Tyler","Ralph"} and
>>  > {"Stiegler","Miller","Close","Hartley"} and you want to print
>>  > Mark Stiegler
>>  > Mark Miller
>>  > Tyler Close
>>  > Ralph Hartley
>> 
>> A very cool example: effectively what you need to do is walk 2 lists in
>> parallel, which even the E for...loop will not do for you 
>> automatically. I
>> have not used this pattern recently, but I have used it. Unless 
>> someone has
>> another clever solution for this, I find it compelling.
> 
> 
> And hence the existence of Source#inspectWith()...
> 
> This particular example really isn't all that great since the data  
> should've been stored in a map.

I think what I really needed to do last time I did this WAS to put the 
data into a map.

> The general problem does exist though, so  that's why inspectWith is 
> in the interface. You are still scuppered if you  want to do more than 
> 2 at a time. I haven't ever needed to. 

I didn't notice that one.

> This probably isn't common enough to require syntax support. 

Perhaps not, but that was just what I needed indexing for the LAST time. 
I doubt any one use would justify it, but cumulatively it's fairly 
common, even though I think elementAt() is ugly.

Ralph Hartley