chuck
chuck copied to clipboard
the time is now: fix class static variables
class Foo
{
5 => static int x;
static SinOsc y;
new SndBuf @=> SndBuf @ z;
}
possible semantics and process:
- identify lines with
static
variables - disallow both
static
and non-static variables in the same line - disallow time-advance (could be a compiler error or a runtime exception for immediate mode violation)
(e.g.,
1::second => static dur a => now;
) - run the static lines a) at compile-time if public class OR b) at run-time if non-public class
int x;
fun int bar()
{
return x+5;
}
class Foo
{
bar() => static int z;
}