[chuck-users] declaration oddity...
Robert Poor
rdpoor at gmail.com
Mon Apr 27 12:41:31 EDT 2009
Dunno if this is a bug or a feature. Seems odd, though. Can someone
explain what's going on?
// Note that the following is perfectly legit
float hx, hy;
fun void h(float x, float y) {
x => hx;
y => hy;
}
// And this works without trouble
float f_x[];
float f_y[];
fun void f(float x[], float y[]) {
x @=> f_x;
y @=> f_y;
}
// But when you elide the array declarations, you get an error:
// NOT on the declaration line, but on the assignment of g_y:
// [decl_test.ck]:line(17): cannot assign '@=>' on types 'float[]' @=>
'float[]'...
// [decl_test.ck]:line(17): ...(reason: --- incompatible types for
assignment)
float g_x[], g_y[];
fun void g(float x[], float y[]) {
x @=> g_x;
y @=> g_y; // this is line (17)
}
More information about the chuck-users
mailing list