51 lines · 1.4 KB · Text
RawDownload
//---------------------------------------------------------------------// name: type-query.ck// desc: this example shows working with the Type type in ChucK//       to query Types currently in the ChucK type system//// version: needs 1.5.0.0 or higher//// author: Ge Wang (https://ccrma.stanford.edu/~ge/)// date: Winter 2023//--------------------------------------------------------------------- // get types currently in ChucK type systemType.getTypes(    Type.PRIMITIVE, Type.BUILTIN) @=> Type types[]; // print results of queryfor( int i; i < types.size(); i++ ){    cherr <= "(builtin primitive types): " <= types[i].name() <= " (" <= types[i].origin() <= ")" <= IO.newline();} // get types currently in ChucK type systemType.getTypes(    Type.OBJECT, Type.BUILTIN) @=> types; // print results of queryfor( int i; i < types.size(); i++ ){    cherr <= "(builtin object types): " <= types[i].name() <= " (" <= types[i].origin() <= ")" <= IO.newline();} // get types currently in ChucK type systemType.getTypes(    Type.OBJECT, Type.CHUGIN) @=> types; // print results of queryfor( int i; i < types.size(); i++ ){    cherr <= "(chugin types): " <= types[i].name() <= " (" <= types[i].origin() <= ")" <= IO.newline();} // get all subclasses of UGenUGen.typeOf().children() @=> types;// print resultsfor( int i; i < types.size(); i++ ){    cherr <= "(UGens): " <= types[i].name() <= " (" <= types[i].origin() <= ")" <= IO.newline();}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t