Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2018 18:53:05 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        Kyle Evans <kevans@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:  <CAG6CVpVBeiZhTB4XTQOm06DwqN_ezHf%2BW7_cHsxMioq_nKyV0Q@mail.gmail.com>
In-Reply-To: <201802180135.w1I1ZkcF097492@repo.freebsd.org>
References:  <201802180135.w1I1ZkcF097492@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 operat=
ors.

>   - Test against 'nil' explicitly rather than relying on 'not' for things=
 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.)

Best,
Conrad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpVBeiZhTB4XTQOm06DwqN_ezHf%2BW7_cHsxMioq_nKyV0Q>