[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: When is multiple assignment good style?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 13 Mar 2017 09:20:52 +0200
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