View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

RawArrray::collect should use (SC3d4)

RawArray::collect creates a kind of Collection and uses it to collect the results of iterating a function on each element of itself. If the Collection created is of the same species as the RawArray that "collect" iterates on, then only functions that return the same kind of elements contained in the initial RawArray can be used. That is,
SymbolArray[\a, \b, \c].collect({ arg s; s.asString })

will not work.

To correct this, RawArray::collect should use
instead of

+ RawArray {
	collect { arg function;
		var i, res;
		res =;{ arg elem, i; res.add(function.value(elem, i)) })

Download this patch as SC file:

Back to Bugs and Fixes
Back to SuperCollider swiki

Link to this Page