lua-users home
lua-l archive

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


On Sat, May 25, 2013 at 3:55 PM, Zach Devito <zdevito@stanford.edu> wrote:
 Function overload [in Terra] works similar to C, just define a Terra function twice:

C or C++?  I was not aware C had overloading.

-Parke

   terra add(a : int, b : int)
      return a + b
   end
   terra add(a : int, b : int, c : int)
       return a +  b + c
   end
   add:printpretty() -- should list 2 definitions for "add"