Debian Codegraph @

examples/machine/machine-shred.ck

raw
1 // on-the-fly shred management
2
3 // this is kind of like using the OTF commands
4 // add / remove / replace etc.
5 // except this is done from code and also can be timed.
6 // (this is also a hack for including other files)
7
8 // infinite time loop
9 while( true )
10 {
11 // the path is relative to where 'chuck' is invoked
12 Machine.add( "../basic/moe.ck" ) => int moe;
13
14 // the operation is sample synchronous
15 500::ms => now;
16
17 // replace
18 Machine.replace( moe, "../basic/wind.ck" ) => int wind;
19
20 500::ms => now;
21
22 // remove
23 Machine.remove( wind );
24 }