irelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.devEnglish · 1 day agoSome of you guys haven't used luarocks and it showslemmy.dbzer0.comimagemessage-square21linkfedilinkarrow-up1240arrow-down12
arrow-up1238arrow-down1imageSome of you guys haven't used luarocks and it showslemmy.dbzer0.comirelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.devEnglish · 1 day agomessage-square21linkfedilink
minus-squarehoppolito@mander.xyzlinkfedilinkEnglisharrow-up13·edit-215 hours agoThat’s a pretty crazy use of Lua if I may say so. It is possible to craft continue-like logic in lua, however, with (out of all things) goto statements. For example, I have the following code in my dotfiles: for _, lang in pairs(loopvar) do if condition then goto continue end <do whatever the loop actually does> ::continue:: end Of course the continue could be called anything. Really felt uncomfortable resorting to this way but it is possible :-)
That’s a pretty crazy use of Lua if I may say so.
It is possible to craft
continue-like logic in lua, however, with (out of all things)gotostatements.For example, I have the following code in my dotfiles:
for _, lang in pairs(loopvar) do if condition then goto continue end <do whatever the loop actually does> ::continue:: endOf course the
continuecould be called anything. Really felt uncomfortable resorting to this way but it is possible :-)