You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2020. It is now read-only.
I stumbled upon Sparkling because I was searching for a very simple and elegant scripting language. You have designed a very beautiful language, but why is there a For-Loop at all? You have omitted that ugly Switch-Case-Stuff because the same can be done with a chain of Ifs and Elses. As everything that can be done with a For-Loop can also be done with a While-Loop, have you considered replacing the current For-Loop with a Foreach-Loop like construct completely like in Python?
for let i in range(10) {
}
for let i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] {
}
…would do exactly the same as…
for let i = 0; i < 10; i++ {
}
…and is even shorter. If it iterates over Arrays (not HashMaps), you could do stuff like:
for let element in ["str", 5, "str"] {
}
for let key in hm.keys() {
print(hm[key]);
}
It would also make people happy who don’t like the semicolons in the For-loop (#24) and you could use the newly introduces in keyword as some Kind of contains operator: