View Single Post
Old 06-11-2019, 10:05 AM   #1040
shamanNS
Wizard
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 1,125
Karma: 12345678
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5, Kobo Libra 2, Kindle PW1
Quote:
Originally Posted by Frenzie View Post
Not only is it not a syntax error, but removing trailing commas is bad practice.

Code:
return {
    ["cre_header_status_font_size"] = 40,
    ["copt_line_spacing"] = 110,
    ["disable_double_tap"] = true,
    ["copt_render_dpi"] = 300,
    ["start_with"] = "last",
    ["disable_kobolight"] = true,
    ["cre_header_status_font_size"] = 30,
    ["full_refresh_count"] = 12,
    ["larger_tap_area_to_follow_links"] = true,
    ["copt_b_page_margin"] = 10,
}
If it was not obvious I was referring to that single comma marked in red color.
So, are you telling me that Lua (or whatever language's 'data structure' / collection/list/array type that code snippet represents) is different than almost any other language under the Sun (even CSS properties list! respect those same conventions) where any type of "enumerating stuff" shouldn't end with a comma as that results in syntax error or parsing error?
Even when returning multiple things as separate objects you wouldn't end that statement with a comma.

Last edited by shamanNS; 06-11-2019 at 10:08 AM.
shamanNS is offline   Reply With Quote