On Wed, 12 Dec 2012, Chris Cannam wrote:
>> arr = array[1..10]
> arr is array<number> = [1,2,3,4,5,6,7,8,9,10]
>> p_arr = new double[10]
> p_arr is double[] = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
>> for [0..9] do i: p_arr[i] := arr[i] done
> java.lang.VerifyError: (class: code$, method: apply signature:
> (Ljava/lang/Object;)Ljava/lang/Object;) Incompatible object argument
> for function call
> at code.apply(<>)
> at yeti.lang.compiler.eval._1(eval.yeti:85)
...
> I can sort of see why this could be a problem, and the workaround is
> easy at least:
>
>> for [0..9] do i: val = arr[i]; p_arr[i] := val done
>> p_arr
> [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0] is double[]
>
> but I'd still have expected the original formula to work?
It was a compiler bug, should be fixed now in git master (the yeti.jar
is also updated).