[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua style guide ?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 10 Jun 2017 11:50:05 +0200
2017-06-10 8:51 GMT+02:00 Sean Conner <sean@conman.org>:
> local cmdline do
> local C = lpeg.C
> local P = lpeg.P
> local SP = P" "
>
> local token = C((P(1) - P" ")^1)
> cmdline = SP^0 * token * (SP * C(P(1)^0))^-1
> end
Your examples demonstrate what one could call a style idiom:
you are defining and initializing a local value, and enclosing
the code needed for that in a do...end group.
- References:
- Re: Lua style guide ?, Peter Aronoff
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Edu Araújo
- Re: Lua style guide ?, Sean Conner
- Re: Lua style guide ?, steve donovan
- Re: Lua style guide ?, Dirk Laurie
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Dirk Laurie
- Re: Lua style guide ?, Sean Conner
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Sean Conner