[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is there a kernel patch for creating local variables programmatically?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 23 May 2013 13:54:45 +0200
2013/5/18 Dirk Laurie <dirk.laurie@gmail.com>:
> Often on this list voices have gone up proposing a language addition
> that would allow one to automate the following process:
>
> local concat,insert,remove,pack,sort,unpack=
> table.concat, table.insert, table.remove, table.pack,
> table.sort, table.unpack
>
> by saying Pythonically
>
> from table import *
>
> or whatever. Has anybody ever actually produced a kernel patch that
> implements something of the kind?
After five days, the answer seems to be "No, because it is impossible."
The opposite task is easier: to automate
mymod = {func1=func1, func2=func2, ... }
That can be done easily enough by an appropriate script that processes
io.open(debug.getinfo(1).source:match"@(.*)"):read"*a"
provided that certain conventions are followed.