lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 11-Nov-04, at 11:54 AM, Mark Hamburg wrote:

 Is it useful to be able
to capture a variable and then create a new variable with the same name in
what appears to be the same scope?

My most common use of the idiom is the following:

  local _, _, capture = string.find(str, pattern)

If you couldn't use nested local's, this would be illegal (and most of my code would break).

Special casing _ strikes me as not a good idea, but perhaps some would like that.

R.