Comment by skydhash
4 months ago
For me it would be like this:
mixed reduce(function fun, array arr, mixed|void zero) {
if(sizeof(arr))
zero = arr[0];
for(int i=1; i<sizeof(arr); i++)
zero = ([function(mixed,mixed:mixed)]fun)(zero, arr[i]);
return zero;
}
I only want to isolate blocks (around 10 lines at most) then I can dive in if necessary. I'm using minimal syntax highlighting in Emacs, but I can do fine without.
sure, probably for me too. i was just trying to demonstrate my point which is that the very compact example becomes a lot more readable with syntax highlighting and therefore it potentially encourages to make code less readable for those who don't use syntax highlighting.