From f8cbfc0bb09b523e96493493ba502ec95b497d16 Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 8 Mar 2014 21:10:24 +0000 Subject: [PATCH] Added lume.lambda() to README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index d2a63df..42141a6 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,15 @@ seconds the function `fn` took to execute followed by `fn`'s returned values. lume.time(function(x) return x end, "hello") -- Returns 0, "hello" ``` +### lume.lambda(str) +Takes a string lambda and returns a function. `str` should be a list of +comma-seperated parameters, followed by `->`, followed by the expression which +will be evaluated and returned. +```lua +local f = lume.lambda "x,y -> 2*x+y" +f(10, 5) -- Returns 25 +``` + ### lume.serialize(x) Serializes the argument `x` into a string which can be loaded again using `lume.deserialize()`. Only booleans, numbers, tables and strings can be