Example does not run
See original GitHub issueFirst example:
fn fib n:
if n < 2: n
else: (n - 1 -> fib) +
(n - 2 -> fib)
[0:10] -> * fib -> print
$ clio run eg.clio
At file "eg.clio" when calling print:
4 │ (n - 2 -> fib)
5 │
6 │ [0:10] -> * fib -> print
^ At line 6 char 19
Exception: BigInt is not defined
Installed as in instruction:
npm i -g clio-lang
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How to not run an example using roxygen2? - Stack Overflow
I'm writing a geocoding function right now that relies on having a Bing Maps Key. Obviously I'd rather not publish mine, and the...
Read more >What to do if your program doesn't run
What to do if your program doesn't run · 1. Look at your output! · 2. Run your compiler with warning messages and...
Read more >Examples not running | Sololearn: Learn to code for FREE!
When i'm trying to run the given example codes (not the pro ones), it says i have to pay for it. But my...
Read more >cargo test does not run tests in examples · Issue #6831 - GitHub
The tests can currently be run by calling cargo test --example foo , so this should not be that complicated to implement.
Read more >Visual Studio Code Frequently Asked Questions
Not only do we write code and work on issues there, we also publish our roadmap ... (for example, the VS Code icon...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ranges are lazy in Clio, here’s why it prints
[object Object]
(it shouldn’t, i’ll fix it soon):[0:10]
compiles tofib
to thisLazyRange
object it becomes:[object Object]
because it is an object. However if you map print to it, it will print the contents correctly. Anyways this isn’t the correct behavior and should be fixed, I’ll look into it, as I said I’m a little busy with the new parser and when I finish I will have more time to fix these issues.I’m afraid most of these will need rewriting so I prefer if I don’t touch the current built-ins / definitions. Also, thanks for testing Clio and reporting the bugs, makes me happy to see people are interested, hopefully we’ll be able to use Clio in production soon, I have lots of plans for this language.
Ah, issue was node was v8.15.0. Works with node v10.14.
But why output is
[object Object]
when output in online editor prints the array?