mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Added lume.lambda() to README.md
This commit is contained in:
parent
cf031025fd
commit
f8cbfc0bb0
@ -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.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)
|
### lume.serialize(x)
|
||||||
Serializes the argument `x` into a string which can be loaded again using
|
Serializes the argument `x` into a string which can be loaded again using
|
||||||
`lume.deserialize()`. Only booleans, numbers, tables and strings can be
|
`lume.deserialize()`. Only booleans, numbers, tables and strings can be
|
||||||
|
Loading…
Reference in New Issue
Block a user