Replies: 6 comments
-
I don't see this one happening. It is both a LARGE breaking change to existing code, as well as a departure from all other languages, just to save 3 extra characters. |
Beta Was this translation helpful? Give feedback.
-
The extra chars from |
Beta Was this translation helpful? Give feedback.
-
In the first step, we can allow use if after else, just add compiler an ability to compile
we can give an additional meaning for else, that can be a conditions also, if an expression follows next. we build a new language easy and powerful, some other languages think they need to have a () for if, here we did as kotlin, rust and go, we just skipped them as a redundant, why not to give people write less and read easier. Plus I see no bivalent meaning in this. |
Beta Was this translation helpful? Give feedback.
-
In terms of readability, a stream of Maybe a better argument would be to ask for replacing If a person doesn't want to deal with |
Beta Was this translation helpful? Give feedback.
-
no, |
Beta Was this translation helpful? Give feedback.
-
please no, no reason for this |
Beta Was this translation helpful? Give feedback.
-
Describe the feature
The suggestion is to make
if
keyword not required afterelse
if a > b { a } else a == b { b } else { a + b }
Use Case
I am always frustrating when I write if after else
if a < b {
println('${a} < ${b}')
} else a > b {
println('${a} > ${b}')
}
Proposed Solution
No response
Other Information
No response
Acknowledgements
Version used
V 0.3.4 046dd54
Environment details (OS name and version, etc.)
Windows,
V 0.3.4 046dd54
Beta Was this translation helpful? Give feedback.
All reactions