irelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.devEnglish · 2 days agoSome of you guys haven't used luarocks and it showslemmy.dbzer0.comimagemessage-square21fedilinkarrow-up1246arrow-down12
arrow-up1244arrow-down1imageSome of you guys haven't used luarocks and it showslemmy.dbzer0.comirelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.devEnglish · 2 days agomessage-square21fedilink
minus-squarehoppolito@mander.xyzlinkfedilinkEnglisharrow-up14·edit-21 day 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 :-)