lua-users home
lua-l archive

Search lua-l

This index contains 143,615 documents and 1,774,615 keywords. Last update on 2023-03-09 .

Query: [How to search]

Display: Description: Sort by:

Results:

References: [ Luis: 514 ] [ Carvalho: 322 ]

Total 256 documents matching your query.

21. Re: Empty? No. Array? No. Has? Yes. (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Wed, 3 Jul 2013 09:24:38 -0400
<snip> I think that arrays address the OP's point well, and it's a simple and elegant solution. As for your solution: the first two points are equivalent to using arrays (or a t.n field at least); fo
22. Re: new "empty" value/type in Lua? (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Tue, 2 Jul 2013 23:17:05 -0400
Right, and that's in the code but you need to use __call instead of setlength. BTW, you don't need arrays to have stacks, but arrays make for a slightly easier implementation. If we allow non-numeri
23. Re: new "empty" value/type in Lua? (score: 60)
Author: Coda Highland <chighland@...>
Date: Tue, 2 Jul 2013 19:19:28 -0700
Being able to shrink an array is vital to using it as a stack. If you don't need to push nils, you can use "t[#t] = val" for a push operation and "t[#t] = nil" for a pop operation. If you have auto-g
24. Re: new "empty" value/type in Lua? (score: 314)
Author: Luis Carvalho <lexcarvalho@...>
Date: Tue, 2 Jul 2013 22:08:36 -0400
No, since 'n' is an existent field (so newindex won't be called.) You can grow the array by setting a[k] for k > t.n, but to really shrink -- that is, to set t[k] = nil for k > n -- you have to use _
25. Re: new "empty" value/type in Lua? (score: 18)
Author: Coda Highland <chighland@...>
Date: Tue, 2 Jul 2013 18:57:40 -0700
--snip-- You didn't put in a way to shrink the array. Probably sufficient to handle calling newindex on n, I suppose. /s/ Adam
26. Re: new "empty" value/type in Lua? (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Tue, 2 Jul 2013 21:20:09 -0400
<snip> That's a good solution, and we could even avoid the metatable by making '#' and ipairs check table.n by default, similarly to Lua 5.0 (but without setlength.) In this sense a table is automati
27. Re: new "empty" value/type in Lua? (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Tue, 2 Jul 2013 20:34:43 -0400
Agreed. I had a very similar version, but required that only integer keys can be set in __newindex and setlength is implemented through __call: local type, floor, pack, setmetatable, rawset = type,
28. Re: Dynamic SQL in Lua (score: 18)
Author: Marc Balmer <marc@...>
Date: Sat, 15 Jun 2013 16:36:58 +0200
Am 15.06.13 15:54, schrieb Luis Carvalho: Thank you for letting me know, I never heard of that binding before. I will take a look and maybe steal some code... ;) Our binding is quite complete these d
29. Re: Dynamic SQL in Lua (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Sat, 15 Jun 2013 09:54:05 -0400
Hi Marc, <snip> I don't know if you've checked luapsql before, https://code.google.com/p/luapsql but it has prepared and parametrizable statements since its first release; it's a fairly complete bind
30. Re: Avoiding temporary tables (score: 18)
Author: Javier Guerra Giraldez <javier@...>
Date: Sat, 1 Jun 2013 15:13:43 +0000
what i do sometimes is to add an optional argument for the copy: myfunc = function (in, dst) dst = dst or in .... do all work, reading parameters from in, writing to dst return dst end so, it's used
31. Re: Avoiding temporary tables (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Sat, 1 Jun 2013 09:01:54 -0400
A simple solution is to add a parameter that specifies if you want a copy or not: local _myfunc = myfunc myfunc = function (x, copy) return _myfunc(copy and copy(x) or x) end Cheers, Luis -- Compute
32. Re: Missing math functions (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Sat, 19 Jan 2013 12:21:08 -0500
<snip> This is slightly off-topic, but here's a pure Lua implementation of inverse hyperbolic trig functions. It also provides log1p since it's needed to keep some precision. Unfortunately, log1p do
33. Re: ANN: SQLiteManager 4 - Working with sqlite databases will never be the same! (score: 18)
Author: Pierre-Yves Gérardy <pygy79@...>
Date: Thu, 13 Dec 2012 04:18:09 +0100
I was about to drop you a line on that topic :-) The module is still refered to as alpha here: http://wiki.postgresql.org/wiki/PL_Matrix , and it isn't mentioned in the manual... http://www.postgresq
34. Re: ANN: SQLiteManager 4 - Working with sqlite databases will never be the same! (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Wed, 12 Dec 2012 21:58:29 -0500
Yes, it is (and support Lua 5.1/5.2 and LuaJIT.) I still have to push the latest updates, probably by the end of this week. BTW, PL/Lua is pretty much feature complete, so most updates are "maintain
35. Re: Separator in table concatenation (score: 18)
Author: Dirk Laurie <dirk.laurie@...>
Date: Sun, 9 Dec 2012 06:51:39 +0200
2012/12/8 Luis Carvalho <lexcarvalho@gmail.com>: .. I agree with two of your points: 1. Having `sep` depend only the key and not on the value does not add much. 2. An enhanced `concat` function may a
36. Re: Separator in table concatenation (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Sat, 8 Dec 2012 10:54:33 -0500
If `sep` depends on the index then isn't it better to simply "merge" tbl and a `sep` table and then concat the result? Alternatively, you might want to have a slightly more general concat function t
37. Re: PostgreSQL PL/Lua (score: 18)
Author: Natanael Copa <natanael.copa@...>
Date: Tue, 6 Nov 2012 08:18:47 +0100
FYI: This patch was needed to make it build against postgresql-9.2 and lua-5.1: -- ./pllua.h.orig Tue Oct 9 17:32:18 2012 +++ ./pllua.h Tue Oct 9 17:32:27 2012 @@ -25,6 +25,7 @@ include <utils/datum.
38. Re: PostgreSQL PL/Lua (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Sat, 3 Nov 2012 15:18:37 -0400
It is being maintained, but not as close to PosgreSQL release cycles. It's pretty much feature-complete, so updating the code to run on the latest version is most of the maintainance. I should be up
39. Re: typed arrays (score: 297)
Author: Luis Carvalho <lexcarvalho@...>
Date: Sat, 29 Sep 2012 13:58:59 -0400
I think that, as Javier said, the "translation" would need a semantic context, and that thus adopting a Py_buffer would be overkill for general purposes; you could simply look at a userdata as a byt
40. Re: statistics in Lua (score: 305)
Author: Luis Carvalho <lexcarvalho@...>
Date: Wed, 30 Nov 2011 10:59:11 -0500
No problem. I forgot to mention--but Michal already did--that you can also check GSL shell, especially if you need plotting facilities and non-linear fitting. Cheers, Luis -- Computers are useless.

Search by Namazu v2.0.21