No Semicolons Needed
terts.dev
No Semicolons Needed
1–10 of 92 posts
Re: No Semicolons Needed
#2 y = 2 * x
- 3
is worth it?Re: No Semicolons Needed
#3Can anyone give a good reason why supporting syntax like: y = 2 * x - 3 is worth it?
such as applicative style formatted like this:
f
x
y
zRe: No Semicolons Needed
#4Can anyone give a good reason why supporting syntax like: y = 2 * x - 3 is worth it?
Re: No Semicolons Needed
#5Re: No Semicolons Needed
#6Can anyone give a good reason why supporting syntax like: y = 2 * x - 3 is worth it?
Because it's very little extra work.
If you want to know if it's a good syntax, AFAIK it's the only way to do a semicolon-less language that doesn't break all the time.
Re: No Semicolons Needed
#7- "We don't need any attributes", like "const" or "mut". This eventually gets retrofitted, as it was to C, but by then there is too much code without attributes in use. Defaulting to the less restrictive option gives trouble for decades.
- "We don't need a Boolean type". Just use integers. This tends to give trouble if the language has either implicit conversion or type inference. Also, people write "|" instead of "||", and it almost works. C and Python both retrofitted "bool". When the retrofit comes, you find that programs have "True", "true", and "TRUE", all user-defined.
Then there's the whole area around Null, Nil, nil, and Option. Does NULL == NULL? It doesn't in SQL.
Re: No Semicolons Needed
#8Elm does this (so maybe Haskell too). For example
x = "hello "
++ "world"
y = "hello "
++ "world" -- problemRe: No Semicolons Needed
#9Can anyone give a good reason why supporting syntax like: y = 2 * x - 3 is worth it?
In PowerShell you can do that by explicitly instructing what the next line is actually a continuation of the previous one:
$y = 2 * $x `
- 3