Re: Suggestion for 5.3: import() for creating a "slew" of locals
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Suggestion for 5.3: import() for creating a "slew" of locals
- From: Philipp Janda <siffiejoe@...>
- Date: 2013年11月19日 01:40:40 +0100
Am 18.11.2013 22:47 schröbte Tim Hill:
(top-posting as general comment…)
Isn’t this really a circular discussion? It seems to me there are two reasons for assigned a function in a table to a local:
— Brevity (easier to type “foo” than “some table.somefunction”)
— Performance (access to locals is faster than access to globals or table values with string keys)
+ Making a module immune to changes in the global environment
+ Providing easy access to globals when you intend to replace `_ENV` (or
use `module`/`setfenv`)
+ Documenting a module's/file's dependencies
+ Asserting that the module's/file's dependencies are there at load time
Philipp