in reply to Re^14: Order in which grep/map receive elements
in thread Order in which grep/map receive elements
In the interests of nitpicking,
I'm not sure how interesting nitpicking is ;), but if we're going that route ...
implemented using a for loop in C, which does operate in a defined and documented order.
It uses the for loop to pick values off the stack, and return qualifying results to the stack, which then get return to the caller in the stacked order.
Which is no different to what grep does. Albeit that the iteration is split between pp_grepwhile() in pphot.c and pp_grepstart() in pp_ctrl.c.
In the end, it is the fact that the list out is derived -- in sequence -- from the list in, that defines the ordering in both cases.
|
|---|