rsc3/doc-schelp/HelpSource/Classes/UnaryOpStream.schelp

28 lines
695 B
Text

class:: UnaryOpStream
summary:: stream modified by a unary operator
related:: Classes/BinaryOpStream, Classes/NAryOpStream
categories:: Streams-Patterns-Events
description::
A UnaryOpStream is created as a result of a unary math operation on a Stream. It is defined to respond to strong::next:: by returning the result of the math operation on the strong::next:: value from the stream. It responds to strong::reset:: by resetting the Stream.
Examples::
code::
x = Routine { 6.do { arg i; i.yield; } }.squared;
x.dump;
::
code::
(
x = Routine { 6.do { arg i; i.yield; } }.squared;
x.next.postln;
x.next.postln;
x.next.postln;
x.next.postln;
x.next.postln;
x.next.postln;
x.next.postln;
)
::