Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2018 21:03:36 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        Conrad Meyer <cem@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r329504 - head/stand/lua
Message-ID:  <CACNAnaHmAuuzqCkCfd-5_N76av3shETdZxHE_K34D2simomNeA@mail.gmail.com>
In-Reply-To: <CAG6CVpVBeiZhTB4XTQOm06DwqN_ezHf%2BW7_cHsxMioq_nKyV0Q@mail.gmail.com>
References:  <201802180135.w1I1ZkcF097492@repo.freebsd.org> <CAG6CVpVBeiZhTB4XTQOm06DwqN_ezHf%2BW7_cHsxMioq_nKyV0Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 17, 2018 at 8:53 PM, Conrad Meyer <cem@freebsd.org> wrote:
> On Sat, Feb 17, 2018 at 5:35 PM, Kyle Evans <kevans@freebsd.org> wrote:
>> Author: kevans
>> Date: Sun Feb 18 01:35:46 2018
>> New Revision: 329504
>> URL: https://svnweb.freebsd.org/changeset/base/329504
>>
>> Log:
>>   stand/lua: More style nits, config.lua
>>
>>   Some other points I think we need to be consistent on:
>>   - Spacing around string concatenation (always)
>
> +1.  ".." is just another (infix) operator, and we put spaces around oper=
ators.
>
>>   - Test against 'nil' explicitly rather than relying on 'not' for thing=
s that
>>     reasonably won't be returning a boolean. e.g. loader.getenv
>>
>>   Eventually this will all get formalized somewhere.
>
> +1.  Ideally sooner rather than later.  Maybe a luastyle.9? :-)
>
> One thing we've done so far I'm not sold on is parentheses around
> conditionals.  Unlike C, this is not a language requirement, and it
> isn't common in other lua codebases, e.g.,
> https://github.com/luarocks/lua-style-guide .  (Take that guide with a
> grain of salt =E2=80=94 it suggests treating nil as boolean false, which =
I
> agree is probably wrong.)

I'm definitely not stuck on the idea of parentheses around
conditionals, but it was inconsistently done before and I wanted to
make some effort to move one way or the other. I started learning lua
here [1] and therefore hold no strong position or prior knowledge, so
if no-parentheses is the Lua way then I'm all aboard. =3D)

[1] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D329274



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaHmAuuzqCkCfd-5_N76av3shETdZxHE_K34D2simomNeA>