linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / Pwhile.schelp
blobf5136fc6162ef1b52e14375226dc8870b1f7efdc
1 class:: Pwhile
2 summary:: While a condition holds, repeatedly embed stream
3 categories:: Streams-Patterns-Events>Patterns>Language Control
5 description::
6 Repeatedly strong::embed:: a link::Classes/Stream:: while the result of code::func:: is code::true::.
9 classmethods::
11 method:: new
12 argument:: func
13 Stream function. In an event stream receives the current link::Classes/Event:: as argument.
14 argument:: pattern
15 A link::Classes/Pattern::.
18 examples::
19 code::
21 z = true;
22 a = Pwhile({ z }, Pseq(#[1, 2, 3]));
23 x = a.asStream;
26 7.do({ x.next.postln; }); // while z == true, the values are embedded
27 z = false; // set z to false
28 x.next; // the rest of the stream is still embedded
29 x.next;
30 x.next; // but then it is not continued.
31 x.next;
32 x.next;
33 x.next;