Search lua-l
This index contains 143,615 documents and
1,774,615 keywords. Last update on
2023-03-09 .
- 361. Re: setfenv/getfenv (score: 6)
- Author: Edgar Toernig <froese@...>
- Date: Thu, 14 Jan 2010 00:00:59 +0100
- My question: why are globals glued to closures anyway? [1] It only makes sense when you want to changes globals. If there's no way to change them, there's no need to attach them to each and every fun
- 362. Re: setfenv/getfenv (score: 3)
- Author: Mark Hamburg <mark@...>
- Date: Tue, 12 Jan 2010 22:10:29 -0800
- Let's look at the common uses of setfenv and getfenv. * Sandboxing untrusted code, * Running a single piece of code in multiple environments. Thank you to Leo for pointing out the PiL example (which
- 363. Re: setfenv/getfenv (score: 3)
- Author: Nicolas <nicolas@...>
- Date: 12 Jan 2010 18:32:22 +0100
- And you expressed my feelings much betetr than I did :) Just to say it again: the concatenation of "in ... do" really feels hackish and detriments an otherwise beautiful language. When I show people
- 364. Re: setfenv/getfenv (score: 2)
- Author: Tony Finch <dot@...>
- Date: Tue, 12 Jan 2010 17:21:59 +0000
- (2) is invalid because setfenv and getfenv cannot manipulate userdata environments in 5.1 so there's no change in 5.2 Tony. -- f.anthony.n.finch <dot@dotat.at> http://dotat.at/ GERMAN BIGHT HUMBER: S
- 365. Re: setfenv/getfenv (score: 3)
- Author: Francesco Abbate <gslshell@...>
- Date: Tue, 12 Jan 2010 18:17:11 +0100
- 2010/1/12 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>: For me this kind of solution is ugly and it clearly reveal that we have a fundamental problem with the new proposed schema. I will try
- 366. Re: Lua registry, environment, and threads. (score: 2)
- Author: Leo Razoumov <slonik.az@...>
- Date: Sat, 9 Jan 2010 06:13:00 -0500
- As it was mention in other postings it is very convenient to load a chunk just *once* and call it later multiple times with different environments to achieve different results. I am not sure whether
- 367. Re: Lua registry, environment, and threads. (score: 3)
- Author: Mark Hamburg <mark@...>
- Date: Fri, 8 Jan 2010 23:40:26 -0800
- I've been trying to pull together a more detailed assessment of my reaction to lexical environments, but I'm still reacting and assessing. I will say that I can appreciate the desire to deprecate set
- 368. Re: Lua registry, environment, and threads. (score: 2)
- Author: Francesco Abbate <gslshell@...>
- Date: Fri, 8 Jan 2010 12:19:40 +0100
- 2010/1/8 Alexander Gladysh <agladysh@gmail.com>: Me too, I want to add my two cents: I've discovered the getfenv/setfenv lately and I regret because it was *very* useful for my code to use it with us
- 369. Re: Lua registry, environment, and threads. (score: 2)
- Author: Alexander Gladysh <agladysh@...>
- Date: Fri, 8 Jan 2010 13:56:27 +0300
- I'm concerned by the sandboxing issue as well. However, in 5.1 proper sandbox already requires using debug library (debug.sethook). Since Roberto said that "official" setfenv and getfenv would move t
- 370. Closed Modules: a Useful Hack (score: 2)
- Author: steve donovan <steve.j.donovan@...>
- Date: Mon, 4 Jan 2010 08:03:55 +0200
- Hi all, The hack du jour is another way to resolve some problems with module [1]. In particular, using module('mymod',package.seeall) means that everything in the global environment is exposed to use
- 371. Re: Regarding the name 'pairs' (score: 2)
- Author: Patrick Donnelly <batrick@...>
- Date: Mon, 14 Sep 2009 10:34:36 -0400
- As John Hind suggested above, it seems that __iter metamethod is the most sensible solution here. The __iter metamethod would be the "fallback" for the expected function in the generic for explist. W
- 372. Some minor FAQ tweaks (a bit delayed). (score: 2)
- Author: Etan Reisner <deryni@...>
- Date: Thu, 13 Aug 2009 20:30:51 -0400
- A number of these tweaks are simple spelling and grammar fixes the rest are various tweaks which make things flow better, read better, sound better, or explain better (at least if you ask me). Feel f
- 373. Re: Sandboxing scripts, luaL_openlibs, and require (score: 33)
- Author: Guy Junk <guyjunkaccount@...>
- Date: Tue, 19 May 2009 21:28:52 -0300
- If I understand you right, loading packages (either through require or luaL_openlibs) places information in both the global table and the register under the field _LOADED. When a library is loaded, L
- 374. Re: Sandboxing scripts, luaL_openlibs, and require (score: 33)
- Author: Patrick Donnelly <batrick@...>
- Date: Sun, 17 May 2009 13:06:30 -0600
- I should add that this trick does not protect you from functions that use the registry for some purpose. The package library (including the require and module functions) utilizes the Lua registry. Th
- 375. Re: Sandboxing scripts, luaL_openlibs, and require (score: 33)
- Author: Patrick Donnelly <batrick@...>
- Date: Sun, 17 May 2009 12:39:18 -0600
- luaL_register [1] is a bit complex in this regard. It does not always create the global table. If the library exists in package.loaded or in the _LOADED field of the Lua registry (they are the same t
- 376. Re: Sandboxing scripts, luaL_openlibs, and require (score: 33)
- Author: Guy Junk <guyjunkaccount@...>
- Date: Sun, 17 May 2009 12:32:39 -0300
- So, libraries are placed in the registry instead of the global table of the current thread when I call "luaL_openlibs" or "register". But, doesn't that mean the libraries are separate from the thread
- 377. Re: Sandboxing scripts, luaL_openlibs, and require (score: 33)
- Author: Patrick Donnelly <batrick@...>
- Date: Sun, 17 May 2009 08:33:54 -0600
- It is possible. Keep in mind luaL_openlibs() uses the Lua registry to find libraries already loaded. Because you want exclusive states, this is not workable. One state could modify the 'math' library
- 378. Re: Sandboxing scripts, luaL_openlibs, and require (score: 33)
- Author: Guy Junk <guyjunkaccount@...>
- Date: Sun, 17 May 2009 11:26:35 -0300
- I have, and it would likely be a lot easier. I've heard that having more than one lua_State though takes up a lot of memory, so I'm trying to see if it's possible to use only one state.
- 379. Re: Sandboxing scripts, luaL_openlibs, and require (score: 34)
- Author: "Anner J. Bonilla" <annerjb@...>
- Date: Fri, 15 May 2009 11:38:55 -0400
- have you consider using different virtual machines for each entity? that's what i am going to do for mine not too sure if it's better than threads but i can hope.
- 380. Sandboxing scripts, luaL_openlibs, and require (score: 34)
- Author: Guy Junk <guyjunkaccount@...>
- Date: Thu, 14 May 2009 21:39:34 -0300
- I am developing a game using C++ where the logic of different entities are controlled by Lua scripts. So, I'd have a collection of scripts that each have a standard set of functions like "nextAction"
Search by
Namazu v2.0.21