rhai: scripts/function_decl3.rhai error
11: print(f(100, 5, 2, 9, 6, 32));
^ Variable not found: KEY (line 6, position 29) in call to function f @ '\\?\C:\Users\vadim\Desktop\Rust\rhai\scripts\function_decl3.rhai'
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16
after update it works.
Just not having enough test coverage, I think that’s the reason. Rhai’s standard library has a large number of functions and methods, and it takes a long time to write complete tests for every single one of them…
Notice that I said test coverage, not tests. There is a test with
insert, just not with zero position. This is a perfect case of not adequate test coverage - the tests do not cover all possible inputs groups.Fixing this probably requires a systematic revision of all the tests - right now they are quite ad hoc.
I’ll continue testing now with the latest version, but I was kinda dissapointed of looking how the scripts from the source repo contain obvious errors (even they get fixed later) why they were uploaded without testing?
Ah yes.
forvariables are values. You’re right this line has no use. It was a left over from the previous version where there was no stepped range and this was awhileloop.Now the stepping is done in the
rangeiterator itselfscripts/primes.rhai line 24: i += p; this does nothing (commenting it changes nothing), looks like values from for loops are well… values, not mutable references