On Sun, Apr 15, 2012 at 5:40 PM, Marcin Cieslak <sa...@saper.info> wrote: >>> Trevor Parscal <tpars...@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 _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l