[Sc-devel] Integer:collect

Julian Rohrhuber rohrhuber at uni-hamburg.de
Tue Oct 2 01:20:22 PDT 2007


for uniformity: wouldn't it be better to have collect only take a 
function, and collectAs taking the class?

	collectAs { arg function;
		var res = (class ? Array).new(this);
		this.do {|i| res.add(function.value(i)) }
		^res;
	}

	collect { arg function, class;
		^this.collectAs(function, Array)
	}
-- 





.


More information about the Sc-devel mailing list