Minor bug in getting started document at start of Section 2.2 Arrays, in the code:
function vectorMultiply(int[] vector, int[] scalar) -> int[]:
int i = 0
while i < |vector|: // needs loop invariant
vector[i] = vector[i] * scalar
i = i + 1
return vector
Scalar is defined as an array (which I assume is just a typo). I would also mention that this code does not compile even with that fixed without the loop invariant i>=0 (unless I am doing something wrong) but perhaps that is intentional (to avoid getting into that discussion so early in the document). If you are not looking yet for such trivial errors given your other work, please just ignore. :)
Really enjoying playing with this language, thanks for making it so accessible!
-Tim (sherwood@cs.ucsb.edu)
Minor bug in getting started document at start of Section 2.2 Arrays, in the code:
Scalar is defined as an array (which I assume is just a typo). I would also mention that this code does not compile even with that fixed without the loop invariant i>=0 (unless I am doing something wrong) but perhaps that is intentional (to avoid getting into that discussion so early in the document). If you are not looking yet for such trivial errors given your other work, please just ignore. :)
Really enjoying playing with this language, thanks for making it so accessible!
-Tim (sherwood@cs.ucsb.edu)