[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] generate seems (slightly) inconsistent



why do we return the state in Object.generate, but not in Function and Integer?
Why do we not take a second arg in Integer?


Function: generate { arg function, item;
		var i=0;
		while {
			item = this.next(item);
			item.notNil
		}{
			function.value(item, i);
			i = i + 1;
		};
	}

Object:generate { arg function, state; this.do(function); ^state }

// override 'do'
Integer:generate { arg function; function.value(this) }

--





.