mherkender / lua.js

An ECMAscript framework to compile and run Lua code, allowing Lua to run in a browser or in Flash
http://blog.brokenfunction.com/
600 stars 73 forks source link

string.format() and sprintf.js #34

Open florentpoujol opened 10 years ago

florentpoujol commented 10 years ago

Hello there !

I am currently adding the missing string functions and I use a fork of sprintf.js to power string.format().

My question is where put the code of sprintf in lualib.js or anywhere in the repo ? Adding a minified version directly in lualib.js works well but I am not sure it's the best way to handle this ? Adding a separate file in src/ and using require() in lualib should works too but I don't have a node.js environment to test this. Or maybe include sprintf's code during the build of lua_paser ?

Also, the oiginal sprintf.js is under the 3 clauses BSD licence, I don't know how it could go along lua.js's licence ?

Thanks for your insights.