[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: When is multiple assignment good style?
- From: Alexey Melnichuk <alexeymelnichuck@...>
- Date: Mon, 13 Mar 2017 11:28:01 +0300
Здравствуйте, Dirk.
Вы писали 13 марта 2017 г., 10:20:52:
> Which of the following uses is in your opinion good style?
> - local a,r,k,n = 10000.0, 5.2, 12, 5 -- initializing locals
> - local a,r,k,n = 10000,0 -- initializing only some
> - local sort, open, min = table.sort, io.open, math.min -- caching
> library functions
> - a,b,c = b,c,a -- permuting values
> - x,t = x+dx, t+dt -- updating related values
> - name,cases,fct = "John", {2,5,6},myfunc -- defining unrelated values
> - local a1,a2,[[...,]]a256 = 1,1,[[...,]1 -- trying to crash the interpreter
I also use
- a,b,c,d = nil -- assign nil to multiple values
--
С уважением,
Alexey mailto:alexeymelnichuck@gmail.com
---
Это сообщение проверено на вирусы антивирусом Avast.
https://www.avast.com/antivirus