Apply a callback to an array: Difference between revisions

Content added Content deleted
Line 1,656: Line 1,656:
Actually, there is a builtin <tt>squared</tt> operator:
Actually, there is a builtin <tt>squared</tt> operator:
<lang SuperCollider>[1, 2, 3].squared; // returns [1, 4, 9]</lang>
<lang SuperCollider>[1, 2, 3].squared; // returns [1, 4, 9]</lang>
[[List Comprehensions|List comprehension]] combined with a higher-order function can also be used:
[[List Comprehension#SuperCollider|List comprehension]] combined with a higher-order function can also be used:
<lang SuperCollider>var square = {
<lang SuperCollider>var square = {
arg x;
arg x;