File: type_primitives.ck

package info (click to toggle)
chuck 1.5.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,260 kB
  • sloc: cpp: 124,539; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 457; python: 174; perl: 86
file content (34 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// quick survey of chuck primitives
// <<<>>> will print the type and value of any variable; 

// integers 
1 => int i; 
<<<i>>>;
// modify value and print again...
2 => i;
<<<i>>>;

// hexadecimal notation
0x22 => i;
<<<i>>>;

// floats 
5.678 => float f; 
<<<f>>>;

// durations are a measure of time 
// the value we print will be in audio samples

9.0::second => dur d; 
<<<d>>>;

now => time t; 
<<<t>>>;

// we advance time, and now will change to reflect 
<<<"waiting 10 seconds...">>>;
10::second => now;
<<<now>>>;

// there is more: see type_analysis.ck for more primitives
// including complex and polar