lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, 14 Aug 2009 00:00:08 -0400
David Manura <dm.lua@math2.org> wrote:
> 
> One of the prototypical problems in [1] was to implement a function
> this:
> 
>   --Wraps a function with trace statements.
>   function trace(f)
>     return function(...)
>       print("begin", f)
>       local result = tuple(f(...))
>       print("end", f)
>       return result()
>     end
>   end
> 

I'd be preferential to the syntax:

-- snip
  print("begin", f)
  ... = f(...)
  print("end", f)
  return ...
-- snip

-- tom
telliamed@whoopdedo.org