gusl: (Default)
[personal profile] gusl
One programming annoyance when writing loops is wanting to access each element of the list without passing the index, i.e. with code like: for (el in list) while simultaneously wanting to know the index without writing i=0 and i++.

I'm not aware of any solutions to this in current usage.

(no subject)

Date: 2010-04-28 06:22 am (UTC)
From: [identity profile] simrob.livejournal.com
I would think this feature would almost be necessary in any language that pronounces "list" as "array" and pronounces "array" as "hashtable." It seems familiar from PHP:

foreach (list as $key => $value)
(do somethig)

(no subject)

Date: 2010-04-28 06:23 am (UTC)
From: [identity profile] simrob.livejournal.com
I should also say in my shame that I second William and Chris's mapi discussion, but they got there first ;-)

February 2020

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags