[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: When is multiple assignment good style?
- From: Nagaev Boris <bnagaev@...>
- Date: Thu, 16 Mar 2017 14:26:16 +0000
On Thu, Mar 16, 2017 at 1:21 PM, Eike Decker <zet23t@googlemail.com> wrote:
> Slightly OT but on topic of how to improve multiple assignments:
> Has anyone ever wished for something like
>
> local sub, gmatch, match load string
> -- where load is a keyword that is syntactic sugar for 'local sub, gmatch,
> match = string.sub, string.gmatch, string.match'
Take a look at http://www.freelists.org/post/luajit/local-in-syntax,24
and https://gist.github.com/meric/1883adb92044b75237bb0b42a63d5ed4
It provides hacks for the following syntaxes:
local exp, log, sin, cos, tan within (math, 5)
and
local import,
asin, acos, atan from (math)
--
Best regards,
Boris Nagaev
- References:
- When is multiple assignment good style?, Dirk Laurie
- Re: When is multiple assignment good style?, Sean Conner
- Re: When is multiple assignment good style?, Tim Hill
- Re: When is multiple assignment good style?, Coda Highland
- Re: When is multiple assignment good style?, Hisham
- Re: When is multiple assignment good style?, Chris Jones
- Re: When is multiple assignment good style?, steve donovan
- Re: When is multiple assignment good style?, Francisco Olarte
- Re: When is multiple assignment good style?, steve donovan
- Re: When is multiple assignment good style?, Francisco Olarte
- Re: When is multiple assignment good style?, Eike Decker