mirven / underscore.lua Goto Github PK
View Code? Open in Web Editor NEWA utility library for Lua
Home Page: http://mirven.github.com/underscore.lua/
License: MIT License
A utility library for Lua
Home Page: http://mirven.github.com/underscore.lua/
License: MIT License
A Lua version of http://documentcloud.github.com/underscore/, see http://mirven.github.com/underscore.lua/ for more information.
When we use underscore like this:
us=require "underscore"
f=us.compose(print,function(a) return a+1 end)
f(1) will trigger this bug.
Maybe in line 359
"return funcs[1](call_funcs%28_.rest%28funcs%29, ...%29)"
should change as
"return funcs1"
Hi, I am trying to port an existing JS framework to Lua, the framework uses underscore.js in most parts, I stumbled upon _.reduceRight
but it's implementation is not found at http://mirven.github.com/underscore.lua
http://mirven.github.io/underscore.lua/
The example does not work:
_.include({1,2,3,4}, function(i) return i%2 == 0 end)
=> true
_.include({1,3,5}, function(i) return i%2 == 0 end)
=> false
I would expect all to treat nil
as false
as with anything else in lua.
However, this is not the case.
> return underscore.all({1,2,3, false})
false
> return underscore.all({1,2,3, nil})
true
While we all know that in lua
> if nil then print "a" else print "nil is like false in lua" end
nil is like false in lua
Add function _.size(table)
to determine number of elements in an arbitrary table (so it will work like #_.keys(table))
http://mirven.github.com/underscore.lua/#chain contains _.({1,2,3,4}):chain()
that's produce error '<name>' expected near '('
in my Lua 5.1.2
But _({1,2,3,4}):chain()
(remove dot) work fine
sad face
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.