[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 'in' keyword today (was Re: mathlib)
- From: steve donovan <steve.j.donovan@...>
- Date: Wed, 9 Apr 2014 10:33:13 +0200
On Wed, Apr 9, 2014 at 10:22 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> There is something not too dissimilar in Penlight -- maybe Steve can
> chip in here.
utils.import(tbl,dest) is a wholesale import (dest defaults to
"current environment" which is just _G; we can do better for both 5.1
and 5.2 here)
I also like 'local .... in T' because of no new keywords; perhaps some
bored capable person could update the patch for 5.2?
As for PA's hack, David Manura suggested an elegant use of
debug.getlocal which unfortunately I can't find in the archives.
Unfortunately, debug.getlocal only returns _active locals_ - if
they're just declared, they don't appear in the runtime record)
because otherwise this form is completely doable:
local _,import,printf,_ = import "pl.utils"
Could get away with this in theory:
local import,printf = slots(2)
import "pl.utils"
But this cure is arguably uglier than the disease...
- References:
- Re: mathlib, Roberto Ierusalimschy
- Re: mathlib, Luiz Henrique de Figueiredo
- Re: mathlib, Roberto Ierusalimschy
- Re: mathlib, Christopher Berardi
- Re: mathlib, steve donovan
- Re: mathlib, Christopher Berardi
- Re: mathlib, Sean Conner
- Re: mathlib, Coroutines
- Re: mathlib, Sean Conner
- Re: mathlib, Christopher Berardi
- Re: mathlib, steve donovan
- Re: mathlib, Coroutines
- Re: mathlib, steve donovan
- Re: mathlib, Coroutines
- 'in' keyword today (was Re: mathlib), Petite Abeille
- Re: 'in' keyword today (was Re: mathlib), Rena
- Re: 'in' keyword today (was Re: mathlib), Philipp Janda
- Re: 'in' keyword today (was Re: mathlib), Coroutines
- Re: 'in' keyword today (was Re: mathlib), Dirk Laurie