[lltx] code style

Khaled Hosny khaledhosny at eglug.org
Wed May 19 21:50:44 CEST 2010


On Wed, May 19, 2010 at 07:07:21PM +0930, Will Robertson wrote:
> Hi,
> 
> Quick questions:
> 
> Why the obfuscation such as 
> 
> local splitpath, expandpath = file.split_path, kpse.expand_path
> local gsub, match, rpadd    = string.gsub, string.match, string.rpadd
> 
> and so on? It makes the code typed shorter, yes, but I've found it harder to read because I haven't known the context of the functions. Is this a regular kind of thing in Lua programming?

Because the first tip you get for "optimizing lua code" is: always use
locals, it is faster.

> 
> Also, four spaces for indenting? Again, is this standard?

I was thinking about switching to two spaces instead, because the code
can get very nested and we get very long lines quite easily.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


More information about the lualatex-dev mailing list