Go to file
Benrob0329 22bdbafb7e Spelling 2021-05-07 02:00:58 +00:00
LICENSE Initial Commit 2021-05-06 20:44:05 -04:00
README.md Spelling 2021-05-07 02:00:58 +00:00
init.lua Initial Commit 2021-05-06 20:44:05 -04:00
lambda-1.0-1.rockspec Forgot a thing 2021-05-06 21:03:37 -04:00
lambda.lua Initial Commit 2021-05-06 20:44:05 -04:00
mod.conf Initial Commit 2021-05-06 20:44:05 -04:00

README.md

lua-lambda

Takes a string, returns a function for quick function definition.

Usage

The lambda format is as follows:

l"(args) expr"

Example:

local l = require("lambda") -- Omit this in Minetest mods

local add_one = l"(x) x+1"
print(add_one(5)) --> 6

Installation

Luarocks

luarocks install lambda

Minetest

This module is available on Minetest's ContentDB, simple add lambda as a dependancy to your mod.conf and Minetest will automatically install the module for end-users. If you wish to manually install this, then you can either clone the repositiory and add it to your mods/ folder or download it here.

Why?

Because Lua needs more atomic modules which add functionality without creating a huge library. This module is supposed to be dead-simple to grab and start using in your project without adding anything extra. One of Lua's strengths is minimalism, and I think that it's ecosystem would do well to mirror that.