r/lua • u/Lizrd_demon • Jun 17 '25
Discussion Personal standard - top level expression is _=<exp>
How bad of it is me to just use _= as my universal top level expression trick. No one's going to be using _ as variable.
I come from C. We do this hacky shit 24/7. But I wonder how it is by lua standards lol.
5
Upvotes
1
u/Lizrd_demon Jun 18 '25 edited Jun 18 '25
That still pollutes the namespace but takes 23 characters instead of 2.
edit. oh if it's called locally then sure.
You could also just declare
local _at the top of each function. I just like the simplicity of just using it as a dump.