Adam D. Ruppe wrote: > so wrote: >> Am i alone thinking D one better here? > > No, I find foreach to be significantly better than the ruby > blocks too. I recently argued on the gentoo forums that > they are virtually equivalent too: > http://forums.gentoo.org/viewtopic-p-6500059.html#6500059 > > opApply is implemented with a delegate!
You can't compare foreach to code blocks. foreach is just one function that enjoys syntactic sugar, whereas code block syntax is available for every function in ruby.
