[chuck-users] crash caused by definition order (bug)

Kassen signal.automatique at gmail.com
Thu Sep 25 04:09:41 EDT 2008


Dear list,

Consider the following;
==============================
spork ~foo();
me.yield();

Gain dest;

fun void foo()
    {
    Gain source => dest;
    }
==================================

Note that this is incorrect, I should have defined "dest" before sporking
foo but mistakes are made... This code crashes my Mini (compiled with the
latest ChucK so non canonical) on Linux outright (the whole thing just
disapears). Variations on this theme under the canonical Windows version
gave a "nullpointer Ugen connection" error and just exited the shred. Sadly
I didn't have the time to document that exact permutation under win
yesterday due to stress about a deadline. The  parser does correctly catch
this;

===============================
fun void foo()
    {
    Gain source => dest;
    }

spork ~foo();
me.yield();

Gain dest;
==========================

..but on a functional level that's the same, the place where a function is
defined doesn't (well, *shouldn't*) matter; I like to keep mine at the
bottom of the file below classes unless it's a especially large function
that's especially fundamental for the structure of the program.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080925/242308aa/attachment-0001.html>


More information about the chuck-users mailing list