Time Nick Message 06:39 user2_ i'm currently installing luanti and multicraft to an old phone to compare them side-by-side- i find it sad they profit of 15 years of unpaid development 07:37 sfan5 luatic: I was thinking the engine could hardcode blank.png to be a blank texture in the code 07:37 sfan5 also prevents someone from trying any funny business by modifying the file 08:46 celeron55 that hardcoding could easily increase the binary size more than 30 bytes though! 11:11 [MatrxMT] lol 11:11 [MatrxMT] seriously I was surprised it's a real file and not just a marker to the graphics pipeline to ignore the texture 17:50 pgimeno @birdlover32767 the ambiguous syntax thing happens in Lua when the last line ends with an identifier IIRC. Ending the previous line with a semicolon should solve it. 17:50 erle_off_ice javascript moment ;) 17:51 pgimeno e.g. a file where a line says: "a = b" and the next line says "(x)()" triggers it 17:54 pgimeno that's because in Lua, a newline is just whitespace, so a = b (x)(y)() could be parsed either as a=b(x) followed by (y)() or as a=b followed by (x)(y)() 17:55 erle_off_ice significant whitespace haters when you inform them other languages than python exist: ☹ 18:01 * user2_ <- python programmer- 18:36 bgstack15 use "/me" 18:36 * bgstack15 demonstrates how to use it 18:44 [MatrxMT] i was doing something like { 18:44 [MatrxMT] ("label[0,1;formspec %s"):format(foo) 18:44 [MatrxMT] "random", } 18:47 Krock birdlover32767: fwiw, make sure that "foo" is formspec escape'd 18:48 [MatrxMT] it is except for cases like numbers or set values (think "image_%s.png") 18:48 [MatrxMT] translations are also escaped 19:28 jonadab I tried to learn Python, but the documentation that the community pointed me to at the time, was terrible, and also I kept running into situations where something that ought to be a one-liner wouldn't even fit in one screen of code, which gave me bad Cobol flashbacks. 19:29 jonadab This was years ago before Python was as popular as now, so I assume the documentation has improved ad interim. 19:29 jonadab But I ended up concluding that learning Python would really be redundant, since I'm already fluent in Perl. 19:33 jonadab lua is neither my favorite, nor my least favorite, of the various functional languages I've worked in. 19:48 bgstack15 "functional language"... as in functional programming? Does Luanti use any of the functional programming within lua? 19:49 [MatrxMT] i mean functions are first class 19:57 bgstack15 Ah, I think we just call that imperative programming. 20:00 luatic pgimeno: the necessary criterion i'd give is that the *next* line is a function call, with the function being an expression wrapped in parenthesis, so something like (expr)(...). 20:03 pgimeno anything with an expression in parentheses would do as the second line I presume, not necessarily a function call, for example this triggers it as well: a = b \n (x).c = 2 20:03 luatic there are a few different options for what the previous line can be as long as it ends with something that could be taken to be a prefixexp. for example local x = t.k (expr)(...) is in principle ambiguous, as is f() (expr)(...) or f"..." (expr)(...). 20:03 luatic pgimeno: fair point, though that is not ambiguous? i think the "ambiguity check" lua implements might just be lazy. 20:04 luatic it's more of a "can i conveniently parse this left to right with little lookahead" check i suppose. 20:04 pgimeno PUC Lua seems to not care, it's LuaJIT the one complaining FWIW 20:05 pgimeno you're right that a = b(x).c = 2 is not valid, therefore it can only split after the b, so it's not actually ambiguous, but a recursive descendent parser is very limited, and that's probably what's being used 20:05 luatic yes 20:06 luatic though actually i think if you put in some work you could also do this using a recursive descent parser, but some implications e.g. for worst case time complexity might not be nice 20:07 pgimeno it might need backtracking perhaps 20:07 luatic yes 20:07 luatic pgimeno: might be misremembering here because i run into it very rarely, maybe once per 10 kloc, but i think it was specific puc lua versions that complained? 20:07 pgimeno yes I seem to remembre that as well 20:07 luatic i think newer lua versions and luajit just pretend the newline is a semicolon if they encounter this "ambiguity" 20:08 pgimeno oh wait, I was trying with 5.2, my bad 20:08 pgimeno yeah, 5.1 complains just the same as LuaJIT 20:09 luatic huh, how is your luajit configured? with or without 5.2 compat? 20:09 pgimeno with 5.2 compat, but I don't think that influences the parsing 20:10 pgimeno but my system's lua runs 5.2 20:11 luatic actually i think i just got it the wrong way around, f() \n (g)() is parsed as f()(g)() by my luajit it seems 20:11 luatic but it does not produce a parse error 20:12 pgimeno yes, it probably stops considering it a function at the newline 20:13 pgimeno oh for me it does error 20:13 luatic no no, that seems to be the funny thing, it considers it a single function call 20:13 luatic pgimeno: looking at the source, luajit will only produce LJ_ERR_XAMBIG #if !LJ_52 20:14 luatic and that seems to be enabled iff LUAJIT_ENABLE_LUA52COMPAT is defined basically (: 20:14 pgimeno ah, with 2.1.1716656478 it doesn't complain indeed 20:15 pgimeno my system's default luajit is 2.0.4 20:16 luatic whoa, older than 2.1? 20:19 pgimeno (er... don't ask)