[*:9zdd9mfh]Because it's a stict-ass MF, which makes it so you can't debug code easily...
I'm trying to edit youtube.lua (from VLC, which unfortunately uses Lua, ugh!). The code is failing, so I'm trying to find out why. I NEED to see the value of vars at different points in the script, to find out why it's failing, so I write this...
vlc.msg.info('youtube.lua debug - return 1 - path('..path..')')...& I get an error msg...
...I'm only trying to concatenate "a nil value" cuz the earlier code is failing & setting path to nil, why can't it just tell me the value is nil...by using my debug code, instead of bombing out?attempt to concatenate global 'path' (a nil value)
So then I write this UGLY ASS code to workaround Lua being a dumbass...
if path==nil then path_disp='nil' else path_disp='yay' end vlc.msg.info('youtube.lua debug - return 1 - path('..path_disp..')')...I have to invent a new var, just so I can output 'nil', when it's nil.
Note: If you have an alternate solution to this problem, plz post it! -- How do I output ANY VAR, regardless of what its value might be? -- this means output nil if it's nil / don't complain that you can't output nil.[/list]
[*:9zdd9mfh]
if then end
(aka: not using braces for blocks) is retarded: you can't easily find the end of the block...but with braces, you can.[*:9zdd9mfh]Not having
!=
is retarded: I can easily do ==
, but I forget every time what Lua changed !=
into![*:9zdd9mfh]Not having
++
& +=
is retarded: there's just NO REASON to not have them! (dumb Lua wants: var=var+1
)[*:9zdd9mfh]Using
..
for concatenation is annoying: +
(plus) works perfectly fine for concatenation AND adding (in JavaScript).[*:9zdd9mfh]Using
nil
instead of null
: I mean, just, WTF?, come on...why?[/list]Basically, there is NOTHING about Lua that makes sense or is good.
Bottom line: If I could avoid writing in Lua, I would. As a language, it just sucks. But it's embedded in VLC, so I must use it. I just wish VLC would embed AutoHotkey or JavaScript...then I could use a REAL language! -- & get stuff done, instead of fighting with STUPID error msgs -- "errors" that are not even errors! -- they are only "errors" cuz the language wants to be strict & act like they are problems worth complaining about, when they are not.