> Does anyone have any thoughts on return versus print generally? Are
> there other reasons we would choose one over the other?

>From a language perspective, I would much prefer return values instead
of side effects, even if those side effects could be converted into a
return value with a special print implementation.

People tend to expect print to produce a visible output in any case,
which will often be violated if the output is collected and then
processed further by other constructs the Lua call is wrapped in. Having
both would also bring up the question what to do when both are provided-
should the return value be appended to the collected printed output?

I am no Lua expert, but would guess that the usual
collect-in-list-and--finally-join method can avoid the performance
penalty in Lua too.

Gabriel


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to