Bruno Ruviaro edited Enclosures.tex  almost 10 years ago

Commit id: f509c4a41721e20433dd6f4e8cdeb6c8adfdce92

deletions | additions      

       

Square brackets define a collection of items, like \texttt{[1, 2, 3, 4, "hello"]}. These are normally called Arrays. An array can contain anything: numbers, strings, functions, patterns, etc. Arrays understand messages such as \texttt{reverse}, \texttt{scramble}, \texttt{mirror}, \texttt{choose}, to name a few. You can also perform mathematical operations on arrays.  \begin{lstlisting}[style=SuperCollider-IDE, basicstyle=\scttfamily\footnotesize]  // Some arrays  [1, 2, 3, 4, "hello"].scramble;  [1, 2, 3, 4, "hello"].mirror;  [1, 2, 3, 4].reverse + 10;