Settings

Theme

Lua's Grammar Is Ambiguous

sebsite.pw

2 points by mikolajw 3 years ago · 3 comments

Reader

lioeters 3 years ago

If you start a line with (, [, +, -, or /, then a semicolon is necessary to disambiguate and prevent it from operating on the previous line.

Personally, I like to put a semicolon at the beginning of such a line only, and omit semicolons otherwise where they're unnecessary.

mdaniel 3 years ago

damn I hate cute code; variables are free and don't lead to "wat" outcomes

  local theShader = (shaderGiven or g3d.shader)
  theShader:send("viewMatrix", camera.viewMatrix)
maybe even without the parens, I'm no lua ninja
wizwit999 3 years ago

like JavaScript

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection