/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/lua/functor/runme.lua
15 строк
418 B
Erez Geva
Remove Lua 5.0 and Lua 5.1 and Lua options
30 май 2026, 19:24
30 май 2026, 19:24
74ff929
Код
Авторство
О чём код?
-- Operator overloading example require('example') a = example.intSum(0) b = example.doubleSum(100.0) -- Use the objects. They should be callable just like a normal -- lua function. for i=0,100 do a(i) -- Note: function call b(math.sqrt(i)) -- Note: function call end print("int sum 0..100 is",a:result(),"(expected 5050)") print("double sum 0..100 is",b:result(),"(expected ~771.46)")