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


Pfunc returns a value obtained from the evaluated function each
call. On reset, the reset function is called.

a = Pfunc({ rrand(8, 10) });
b = a.asStream;{ });

Pfuncn does that only a certain number of times:
a = Pfuncn({ rrand(8, 10) },4);
c = Pfuncn({ rrand(1.0, 2.0) },4);
b = Pseq([a, c], inf).asStream;{ });

Prout creates a Routine instead, that will yield values without
restarting and thus no reassignment of any variables:
a = Prout({{arg i;
		Pshuf([1, 2, 3]).embedInStream
b = a.asStream;{ });

Links to this Page