lua-users home
lua-l archive

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


On Wednesday 05 April 2006 2:19 pm, Diego Nehab wrote:
> While we are at it, anyone thought about having ... as an "l-value"?
>
>      function capture(s, pat)
>          local i, j, ... = string.find(s, pat)
>          return ...
>      end

i like that!

of course, you could always do:

  function skip2 (_, _, ...)
     return ...
  end
  function capture(s, pat)
     return skip2 (string.find(s, pat))
  end

but gets ugly for many situations

-- 
Javier

Attachment: pgpTaMeBOfGA_.pgp
Description: PGP signature