On Sun, Apr 15, 2012 at 5:40 PM, Marcin Cieslak <saper(a)saper.info> wrote:
Trevor Parscal <tparscal(a)wikimedia.org> wrote:
+1 to all the points for using return values.
Zope has a nice solution here:
print "Asdsds"
prints actually to the internal magic variable "printed"
which has to be returned later with
return printed
if it's going to end up as the function result.
Not sure if this is possible in Lua.
//Saper
This might be possible, but I would still prefer only supporting
return. The advantage here is that it needs an explicit return. The
disadvantage is that it needs magic, making it harder to understand
and less clean in design, and you would still have to chase all print
calls in nested functions to know what is happening, and where output
is created.
Martijn