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/

2022-10-12 Β· 99 words