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

29 lines
695 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
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;
)
::