home/ atoms/ sc-enclosure-types

SuperCollider has four enclosure types: () for argument lists and code blocks, [] for arrays, {} for functions, and "" for strings

SC’s four enclosures carry specific meaning: Parentheses () enclose argument lists, force operator precedence, or delimit code blocks. Square brackets [] create Arrays. Curly braces {} define Functions. Double quotes "" create Strings. Single quotes '' or a leading backslash \ create Symbols. Every opened enclosure must be closed; the IDE highlights matching pairs. Misbalanced enclosures are among the most common SC syntax errors.

Examples

(2 + 3) * 4;           // () for precedence
[1, 2, 3].reverse;     // [] array
{rrand(0,10)}.dup(5);  // {} function
"hello".size;          // "" string
\mySym;                // symbol

Assessment

List all four enclosure types in Pbind(\note, Pseq([60,62,64], 2)). Identify what role each plays.

“Therearefourtyp esofenclosures:(parentheses),[brackets],{braces},and"quotation marks". Eachonethatyouop enwillneedtob eclosedatalaterp oint.”
corpus · a-gentle-introduction-to-supercollider-bruno-ruviaro · chunk 7