DEV Community

Discussion on: How Lua Avoids Semicolons

Collapse
 
justinctlam profile image
Justin Lam

Swift doesn't require semicolons either but you can add them if you want to put several statements on the same line.

I like Swift, it's a nice language.

Collapse
 
17cupsofcoffee profile image
Joe Clay • Edited

Swift seems really cool! I'd like to check it out at some point, but they don't distribute Windows binaries, and I'm too lazy to compile from source... Eventually, though :p

Christopher Durham left a really interesting comment on my previous thread, explaining how Swift handles expressions-as-statements without creating syntax ambiguities. If I'm reading it right, they add a little bit of whitespace significance around operators to make it unambiguous whether they're infix, prefix or suffix. Another really clever solution to this problem :)