[chuck-users] Bus error when defining two vars of the same type and
on the same line in a class
eduard
eduard.aylon at gmail.com
Fri Sep 2 17:41:23 EDT 2005
Hello all,
I am getting Bus error when I define two member vars of the same type
and on the same line in classes.
example code:
public class foo_class
{
float a, b; <-------- line causing the problem.
fun void div(float x, float y)
{
x => a;
y => b;
<<< "result: ", x/y >>>;
}
} // end_of_foo_class
// instantiation:
foo_class foo;
// call function: here comes the problem
foo.div();
The problem arises when any member function is called. No problems at
all when instantiating.
However if one replaces the line " float a,b; " by separate
declarations of a and b then it works fine, thus:
float a;
float b;
I've not been able to reproduce the error when float a, b; is
declared outside of a class. Thus the following works ok:
float a, b;
fun void div(float x, float y)
{
x => a;
y => b;
<<< "result: ", x/y >>>;
}
while( true ) div( std.rand2f(0.0001, 1), std.rand2f(0.0001,1) );
Eduard
More information about the chuck-users
mailing list