loops: having my cake and eating it too?
Apr. 27th, 2010 07:43 pmOne programming annoyance when writing loops is wanting to access each element of the list without passing the index, i.e. with code like:
I'm not aware of any solutions to this in current usage.
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-29 05:19 am (UTC)mapi (fn (i, el) => ... code(i, el) ...) listis less elegant than
because
* the Python fewer tokens
* in the ML, what the heck is "..." anyway?
* in the ML, one explicitly writes the lambda. One of the reasons Paul Graham invented Arc is because "lambda(x)" appears too often in Lisp.
(no subject)
Date: 2010-04-29 01:32 pm (UTC)(no subject)
Date: 2010-04-29 01:40 pm (UTC)(no subject)
Date: 2010-04-29 01:44 pm (UTC)