File: machine-shred.ck

package info (click to toggle)
chuck 1.5.5.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,056 kB
  • sloc: cpp: 123,473; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 457; python: 174; perl: 86
file content (24 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// on-the-fly shred management

// this is kind of like using the OTF commands 
//     add / remove / replace etc.
// except this is done from code and also can be timed.
// (this is also a hack for including other files)

// infinite time loop 
while( true )
{
    // the path is relative to where 'chuck' is invoked
    Machine.add( "../basic/moe.ck" ) => int moe;

    // the operation is sample synchronous
    500::ms => now;

    // replace
    Machine.replace( moe, "../basic/wind.ck" ) => int wind;

    500::ms => now;

    // remove
    Machine.remove( wind );
}