[chuck-users] preprocessing chuck (was: Time to SMIRK!)
Scott Wheeler
wheeler at kde.org
Sat Oct 4 19:21:26 EDT 2008
Stephen Sinclair wrote:
> Take note, though, that using #include is not the same thing as
> telling ChucK to pre-load another file! With #include the code is
> parsed and loaded into the VM as many times as it appears, so it's not
> the same thing as sharing public classes within the VM. In particular
> if you #include a file with a public class ChucK will refuse to load
> it twice. You'll also run into trouble if you try to #include two
> different files declaring public classes, since you can only have one
> public class per file.
>
My preprocessor works around those things (no double includes,
specifically), and as mentioned, the one that was really important for
me is that it takes the error output from the chuck executable and
retranslates it back to the original source file where the error came
from. I don't find the "public" mechanism in ChucK particularly useful.
I just copied over my ChucK directory to my home page space -- there are
a bunch of classes there in a couple thousand lines of code, some
working some not, but it should give an idea of how I use the include
mechanism.
http://developer.kde.org/~wheeler/files/src/ChucK/
-Scott
More information about the chuck-users
mailing list