Closed Ivo-Balbaert closed 3 years ago
I removed branching in 0.6 release, it made the compiler unnecessarily complicated. I think this is a very nice feature, but it isn't worth it, as it adds a lot of ambiguity to the code. The same goes for the await blocks that you reported on Telegram.
If you check the documentation for v0.6 these changes are reflected in the documentation, however for some reason they're not in v0.7 documentation. Looks like I forked the wrong documentation version for 0.7, I will fix the docs with 0.8 release.
Fixed in 0.8, already in production. Thanks for reporting!
In the current documentation the branching section is still present:
Describe the bug
The following branching code does not compile:
To Reproduce Executing this code with the Playground link on the page gives the error:
[Error: Parsing error at main.clio[4:0]
fn add a b: a + b
fn mul a b: ^
Expecting one of eof, clio but encountered function]
Same error on Windows 10 (clio 0.7.0, node 14.16.1 npm 6.14.12). clio run
Info: Creating build for node
fn add a b: a + b
fn mul a b: ^
Expecting one of eof, clio but encountered function
Same error on Ubuntu 20
Expected behavior Program should compile and print out: [2 3 4] [4 6 8]
**Versions
Additional context The 2nd branching example also does not compile:
The compile error is: [Error: Inconsistent indentation] It occurs on the same platforms