On Sat, Feb 17, 2018 at 8:53 PM, Conrad Meyer <c...@freebsd.org> wrote: > On Sat, Feb 17, 2018 at 5:35 PM, Kyle Evans <kev...@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 > operators. > >> - 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 — 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. =) [1] https://svnweb.freebsd.org/base?view=revision&revision=329274 _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"