rxi
30991649f8
Added lume.match()
2014-04-04 18:08:39 +01:00
rxi
dbd93b3861
Moved position of lume.combine() in readme and other files
2014-04-03 20:17:31 +01:00
rxi
8311519e3f
Added test for lume.combine() to test_lume.lua
2014-04-03 20:10:08 +01:00
rxi
82c697b08e
Added lume.combine() to README.md
2014-04-03 20:09:56 +01:00
rxi
5db6be936a
Added lume.combine() function
2014-04-03 20:09:40 +01:00
rxi
335b928cae
Removed function in lume.slice()
...
Moved the function index() from lume.slice()'s body to local var
absindex, this improves the performance of lume.slice() on luajit
significantly and improves it to a lesser extent on non-jit lua.
2014-04-01 20:16:39 +01:00
rxi
94977b4f7e
Updated test for lume.trace()
2014-03-30 18:38:45 +01:00
rxi
e6246834b7
Changed lume.trace() to round numbers to 2 decimal places
2014-03-30 18:31:14 +01:00
rxi
9bf2d24ee2
table.unpack() is now used if unpack() is not available.
2014-03-29 10:02:48 +00:00
rxi
89931c1ad8
Version 1.2.1
2014-03-27 17:57:19 +00:00
rxi
9ff4637201
Moved shared code of lume.split/trim() to local func
2014-03-19 21:05:34 +00:00
rxi
617729e261
Added more tests for lume.trim()
2014-03-19 20:18:32 +00:00
rxi
ad64d7af05
Fixed use of pattern special chars in lume.trim()
...
Using lua pattern special chars in the `chars` argument of lume.trim()
are now handled correctly and treated like any other character.
2014-03-19 20:14:48 +00:00
rxi
d69f419f5a
Improved lume.split()'s README.md section for clarity
2014-03-19 19:49:50 +00:00
rxi
ad34f6ce33
Updated lume.split() in README.md
2014-03-19 13:02:55 +00:00
rxi
5882ca1303
Fixed minor error in lume.set()'s README.md example
2014-03-19 12:54:14 +00:00
rxi
828d23e6f6
Added new tests and updated some others for lume.split()
2014-03-19 12:53:01 +00:00
rxi
13a8edb2e7
Changed lume.split() to mimic python's str.split()
...
The lume.split() function now mimics python's str.split() function,
though it does not support the third argument (maxsplit)
2014-03-19 12:51:35 +00:00
rxi
425a52b99f
Fixed spelling mistake in README.md
2014-03-18 18:01:12 +00:00
rxi
a234e36975
Version 1.2.0
2014-03-18 12:12:38 +00:00
rxi
4ba373c2d1
Localised global funcs/variables
...
Set most of the global funcs / variables which are used to local
variables. This offers better performance in lua 5.1 and 5.2, and seems
to make no difference in luaJIT.
2014-03-18 12:07:53 +00:00
rxi
c537d00a47
Added type tests for lume.random()
2014-03-18 12:04:36 +00:00
rxi
2c3be23a2b
Added test for lume.lambda() caching
2014-03-15 21:58:35 +00:00
rxi
be40cd6276
Added caching to lume.lambda()
2014-03-15 21:58:26 +00:00
rxi
c971cee753
Added more tests for lume.slice()
2014-03-13 21:53:07 +00:00
rxi
151b57adc6
Fixed behaviour for negative i argument on lume.slice()
...
A negative value for the `i` argument of lume.slice() is now handled
properly (used as an index from the end of the string) to mimicing the
behaviour of lua's string.sub()
2014-03-13 21:32:22 +00:00
rxi
cbafc49e8a
Added "unsupported type" error to lume.serialize()
...
The unsupported type error is raised if an unsupported type is
encountered in the table we are trying to serialize.
2014-03-12 21:16:32 +00:00
rxi
fcb1fa90d4
Reworded description of lume.weightedchoice() in README
2014-03-12 13:16:36 +00:00
rxi
2a6d1ea9a8
Added some tests for lume.weightedchoice()
2014-03-12 13:12:55 +00:00
rxi
2d7fa98155
Added lume.weightedchoice()
2014-03-12 13:12:45 +00:00
rxi
af4c919be4
Added tests for lume.lambda()
2014-03-09 00:11:06 +00:00
rxi
abdfd78354
Added tester.test.error() to tester.lua script
2014-03-08 23:00:47 +00:00
rxi
fbb5cbac1a
Replaced table concat with str concat in lume.lambda()
...
This offers an improvement in performance for the function on Lua5.1,
5.2 and JIT 2.0.2
2014-03-08 22:19:55 +00:00
rxi
f8cbfc0bb0
Added lume.lambda() to README.md
2014-03-08 21:18:05 +00:00
rxi
cf031025fd
Added lume.lambda()
2014-03-08 21:08:56 +00:00
rxi
4db5a6b683
Added another test for lume.reduce()
2014-03-08 16:19:31 +00:00
rxi
a4fe134985
Version 1.1.2
2014-03-08 16:10:16 +00:00
rxi
cbff46bdfb
Fixed empty-table test for lume.invert()
2014-03-08 16:08:58 +00:00
rxi
5e15a57f37
Moved lume.invert()'s test func to match order in lume.lua
2014-03-08 15:47:28 +00:00
rxi
2f388bc2c7
Moved lume.invert() to be near lume.clone()
...
This makes the series of python-like functions (map, all, any, reduce,
set, filter) consecutive in the source and readme, which seems like a
more logical order.
2014-03-08 15:23:13 +00:00
rxi
8f4d1b158f
Added empty-table test for lume.set()
2014-03-08 14:48:04 +00:00
rxi
1bbb795a89
Changed lume.set() to make use of lume.invert()
2014-03-08 14:47:27 +00:00
rxi
2c71079ef3
Added tests for lume.invert()
2014-03-08 14:45:18 +00:00
rxi
8a76fd7595
Added lume.invert()
2014-03-08 14:45:08 +00:00
rxi
b4bea5f4e0
Added new tests for lume.reduce()
2014-03-06 19:41:14 +00:00
rxi
51189d190d
Made first argument in lume.reduce() optional
2014-03-06 19:33:13 +00:00
rxi
e6d47627cd
Increased version to 1.1.1
2014-03-05 21:52:28 +00:00
rxi
05828bd840
Fixed module's table not updating in lume.hotswap()
...
Changed the returned values from pcall() in lume.hotswap() to be handled
correctly -- the second return value being the wrapped-function's first
return value. This bug would effect hotswapped modules which used the
modern approach of returning a table rather than creating globals.
2014-03-05 19:11:14 +00:00
rxi
83a051aadb
Improved lume.clamp()'s performance on non-JIT
...
Removed use of the functions math.max() and math.min() and replaced them
with and/ors:
[5000000 calls, Lua5.2]
old func: 1.37 seconds
new func: 0.53 seconds
2014-03-05 12:44:19 +00:00
rxi
2699094218
Added better tests for lume.distance()
2014-03-05 12:22:05 +00:00
rxi
a08436445d
Improved lume.distance()'s performance on non-JIT
...
Replaced use of the exponent operator with multiplications, yielding a
performance increase on non-JIT Lua:
[5000000 calls, Lua 5.1]
old func: 2.03 seconds
new func: 1.17 seconds
[5000000 calls, Lua 5.2]
old func: 1.60 seconds
new func: 0.89 seconds
[2000000000 calls, LuaJIT 2.0.2]
old func: 0.89 seconds
new func: 0.89 seconds
2014-03-05 12:18:49 +00:00
rxi
1cc16ffacd
Increased version to 1.1.0
2014-03-04 23:12:50 +00:00
rxi
8451a0817a
Added tester.lua script and tests in test_lume.lua
2014-03-04 23:10:34 +00:00
rxi
f144927542
Added optional arg squared to lume.distance()
2014-03-04 22:53:31 +00:00
rxi
be71dbda78
Updated README.md on lume.randomchoice()'s behaviour
2014-03-04 21:21:50 +00:00
rxi
dcc08346a2
Fixed lume.hotswap() to handle nonexistent modules properly
2014-03-04 12:35:35 +00:00
rxi
fb64932134
Added support for numerical keys to lume.format()
2014-03-04 12:18:50 +00:00
rxi
bdb2f0003e
Made lume.dostring() use load() if no loadstring()
...
lume.dostring() now checks if the loadstring() function (deprecated in
lua5.2) exists, and uses load() if it does not.
2014-03-03 22:10:58 +00:00
rxi
97907d5d13
Changed lume.format() to abort early if vars is nil
2014-03-03 21:08:19 +00:00
rxi
8283410210
Substituted use of var name "arg" in lume.fn()
...
The use of a variable called "arg" was causing a bug in lume.fn() for
lua5.1 which creates a table named "arg" when a variable number of
arguments are used. The variable name has been changed to "args" to
avoid the conflict.
2014-03-03 21:01:39 +00:00
rxi
d1e6c0334b
Changed 'vars' arg in lume.format() to be optional
2014-03-03 20:37:15 +00:00
rxi
778e7f9800
Fixed lume.format() where missing keys were not ignored
2014-03-03 20:33:39 +00:00
rxi
bebf8d4fca
Fixed bug with negative j index in lume.slice()
...
Fixed a bug where giving lume.slice() a negative j index (or no j index)
would not result in the correct slice -- the behaviour now correctly
matches that of string.sub() when passing a negative j index.
2014-03-03 18:56:12 +00:00
rxi
0c085ad5c1
Updated README.md for changes in lume.fn()
2014-03-03 13:35:20 +00:00
rxi
4bb6f24213
Changed lume.once()'s return fn to handle args
2014-03-03 13:25:53 +00:00
rxi
c407ef9445
Changed lume.fn()'s returned fn to handle args
2014-03-03 13:20:51 +00:00
rxi
267f003f5e
Fixed typos and improved for clarity in README.md
2014-03-03 12:11:57 +00:00
rxi
1cedfd9464
Added lume.each() function
2014-03-03 12:08:11 +00:00
rxi
bfcc23d285
Increased version to 1.0.9
2014-03-02 21:32:57 +00:00
rxi
f2877dbd6e
Added increment rounding to lume.round()
2014-03-02 21:30:15 +00:00
rxi
d344b9d04e
Added some more examples to README.md
2014-03-02 20:59:32 +00:00
rxi
fbe585fc85
Added lume.trace() function
2014-03-02 20:48:21 +00:00
rxi
3324bb013c
Added error handling to lume.hotswap()
...
Changed lume.hotswap() to return an error and restore the global
environment if an error occurs when requiring the new package
2014-03-02 17:15:39 +00:00
rxi
b3773ee57d
Fixed typo in README.md on lume.angle()'s args
2014-03-02 01:56:52 +00:00
rxi
842e367ccd
Changed lume.fn/once's returned func return, v1.0.8
...
* The functions which lume.fn() and lume.once() return now return their
inner functions' return value instead of nil
* Moved lume.once() in lume.lua and README.md to be near its similar
functions -- lume.fn() and lume.time()
2014-03-02 00:33:55 +00:00
rxi
d65556bc83
Fixed formerly broken lume.angle(), version 1.0.7
2014-03-01 20:27:33 +00:00
rxi
ba6bb964b0
Changed README.md to link to raw module, reworded
2014-03-01 15:45:12 +00:00
rxi
547446074f
Added lume.hotswap() fn, updated version to 1.0.6
2014-03-01 15:18:40 +00:00
rxi
0d85bd630f
Added lume.time(), incremented version revision
2014-02-28 19:40:16 +00:00
rxi
29acc4accc
Fixed typos and improved clarity in README.md
2014-02-28 13:50:05 +00:00
rxi
e018498a0d
Changed args for lume.any/all(), fixed README.md
...
* The functions lume.any() and lume.all() now have a default function if
one is not provided -- their default behaviour with a single argument
now matches that of Python.
* Updated README.md to reflect changes
* Fixed typo in lume.any()'s example in README.md
* Incremented version revision number
2014-02-28 12:51:50 +00:00
rxi
50eb3d9f52
Changed first arg of lume.reduce to non-optional
2014-02-28 00:30:01 +00:00
rxi
736982c336
Fixed error in lume.random()'s description
2014-02-27 23:40:40 +00:00
rxi
3eec98906b
Removed "len" argument from lume.pingpong()
2014-02-27 23:35:07 +00:00
rxi
02cdf32bdd
Fixed lume.filter() example in README.md
2014-02-27 23:23:28 +00:00
rxi
602cf574fa
Fixed incorrect lume.merge() example in README.md
2014-02-27 23:20:38 +00:00
rxi
072e3149c2
Updated version number
2014-02-27 22:55:19 +00:00
rxi
e40f51c811
Fixed even more typos in README.md
2014-02-27 22:53:31 +00:00
rxi
34b2013c71
Changed funcs to treat tables as arrays by default
...
Changed the lume.set(), lume.merge() and lume.filter() functions to take
the argument `retainkeys` instead of `isarray`, and to treat the table
as an array by default (avoiding sparse arrays) instead of treating the
table as an associative array by default (retaining keys).
2014-02-27 22:42:42 +00:00
rxi
eeadcd307d
Added isarray argument to lume.set
2014-02-27 22:17:36 +00:00
rxi
2636035974
Fixed incorrect description of lume.round()
2014-02-27 22:03:00 +00:00
rxi
011b26943a
Fixed accidental use of global in lume.clone()
2014-02-27 21:31:26 +00:00
rxi
3d1054886f
Fixed typos/errors and reworded things in README.md
2014-02-27 21:11:31 +00:00
rxi
c863629a94
Fixed more typos in README.md
2014-02-27 20:29:44 +00:00
rxi
7073d797ff
Removed stray bracket in README.md
2014-02-27 20:22:49 +00:00
rxi
2f51dce71f
First commit
2014-02-27 20:19:10 +00:00