lua-users home
lua-l archive

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




On Mon, Jul 30, 2018 at 17:12 dyngeccetor8 <dyngeccetor8@disroot.org> wrote:
On 07/31/2018 12:00 AM, Sean Conner wrote:
> [...]  I line up sequential
> assignments in my code:
>
>       local iostream =
>       {
>         close     = close,
>         flush     = flush,
>         lines     = lines,
>         read      = read,
>         seek      = seek,
>         setvbuf   = setvbuf,
>         write     = write,
>         
>         _readf    = accumulate_data,
>         _readbuf  = "",
>         _writebuf = "",
>         _sock     = conn,
>         _remote   = remote,
>         _pollset  = nfl.SOCKETS,
>         _eof      = false,
>       }
>
>   That works for me; it probably doesn't work for anybody else.  That's my
> habits from Assembly language past showing here.

Good luck with renaming field to identifier with different length.

Looks like we're off-topic here and just criticizing others habits
while showing ours. So lets continue!

I've discovered my median Lua chunk size is about 12 lines (with 70
chars limit and 2-space indent). That's to talk about "screens".

I use upvalues mostly in recursive functions (where you can't call
itself without previous declaration).

And separate almost any "function" statement as separate module.
That is why I was need relative require().

-- Martin

[way off topic] recursion in Lua is really awesome with upvalues and tail call elimination.