LuaFun - LuaJit Functional
Intro LuaFun ์ ์ - LuaJit Hight Performance Functional Programming Library luajit์ ๋ด์ฅํจ์๋ฅผ ํ์ฅํ์ฌ ๋ค์ํ ํ๋ก๊ทธ๋๋ฐ์ ๋๋๋ค. ํ๋์ฉ ๊ณต๋ถํด์ ํ์ฉํ๋ฉด ๋งค์ฐ ๊ฐ๋ ฅํ ํด์ด ๋ ๊ฒ์ด๋ค. Usage ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ $ git clone https://github.com/luafun/luafun.git $ cd luafun $ luajit -i > -- Functional style > require "fun" () > -- calculate sum(x for x^2 in 1..n) > n = 100 > print(reduce(operator.add, 0, map(function(x) return x^2 end, range(n)))) 328350 > -- Object-oriented style > local fun = require "fun" > -- calculate sum(x for x^2 in 1..n) > print(fun.range(n):map(function(x) return x^2 end):reduce(operator.add, 0)) 328350 Using the Library Links github https://github.com/luafun/luafun Document https://luafun.github.io/