forall
チャペルのを使ったときにループが何回実行されるか知りたい CDO ライブラリを使用するこのコードは失敗しますが、そうするのが正しいと確信しています。誰かが私に良い例を教えてもらえますか?
var j:int = 0;
writeln("\n=== FORALL LOOP ===");
forall row in cursor {
writeln("from: ", row['from_nm'], "\tto: ", row['to_nm']);
j += 1;
}
writeln("Expected 10 rows, got ", j);
エラーは
faerr.chpl:59: error: illegal lvalue in assignment
faerr.chpl:57: note: The shadow variable 'j' is constant due to forall intents in this loop