irelephant [he/him] ( irelephant@lemmy.dbzer0.com ) to Programmer Humor@programming.devEnglish · il y a 11 moisSome of you guys haven't used luarocks and it showslemmy.dbzer0.comimagemessage-square13linkfedilinkarrow-up1169
arrow-up1169imageSome of you guys haven't used luarocks and it showslemmy.dbzer0.comirelephant [he/him] ( irelephant@lemmy.dbzer0.com ) to Programmer Humor@programming.devEnglish · il y a 11 moismessage-square13linkfedilink
minus-squarehoppolito ( hoppolito@mander.xyz ) linkfedilinkEnglisharrow-up15·edit-2il y a 11 moisThat’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 :-)