Alternatively, you can declare a function before defining it:
terra isodd :: uint32 -> bool
What's the syntax for methods?
I tried:
terra T.method :: &T -> {}
terra T:method :: {} -> {}
but none seem to work, and the error is:
C:\projects\terra\src\asdl.lua:31: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
[C]: in function 'ipairs'
C:\projects\terra\src\asdl.lua:31: in function 'insertall'
C:\projects\terra\src\terralib.lua:1013: in function 'desugarmethoddefinition'
C:\projects\terra\src\terralib.lua:1083: in function 'defineobjects'
The doc says:
What's the syntax for methods?
I tried:
but none seem to work, and the error is: