<snapdata remixID="13832361"><project name="Assembly" app="Snap! 10.7.1, https://snap.berkeley.edu" version="2"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAAA/VJREFUeF7t3DGPEkEYh/F3SUxsbLmY2BEo0QI7GuwtqCygtiSh4hNAa0J5n4AE6OhtqE2khwYbGwwxIaLimrtEIjGLzGZ3/7fMY+uy784zP0UmeEEYhqHxiwKiAgEAReUZe18AgECQFjgBuFwuU3mYUqmUyn25af4LOAG8uW1ctOLPb9+fXAfAi7J5eZEDwNBubl9dFOnL63f2/emL47UAvCiblxdFAlyv19Zut63f71u9XjczAHopJOVFRwLs9Xq23W7vEUYBfPTyjf34MDU7/Dx5TP4GTHnXruj2vAVf0WbmcSkOAO+Wd+mZdcCHkDxqEDyzI8B4T8iHkHjdfHiVE0COYXwgke0aHQDyKTjbrfFjWiTA+XxunU7HhsPh2WOY4PETC7995VOwH14SX+VZgNVq1RaLRSTAwrPn9uvTx38eimOYxPfpam/IW/DVbm0+FuYAkGOYfGxpvp7SEWC8xXEME6+bD69yAsgxjA8ksl2jA0COYbLdGj+mRQI8HA7WaDRsMBhwDOOHBckqIwFOp1MrFosWBAHHMJKt8WMob8F+7PODXaUDQI5hHuwu5vjBHAHGWynHMPG6+fAqJ4Acw/hAIts1OgDkGCbbrfFjWiTA3W53/CbMuf+UxLdh/ICS1iojAY5GI7v7Nsxms+EYJq363Pf0R3Oc/8kIvAXjJfkCDv8G5Bgm+fzckR9OhAFpAQBK8zMcgBiQFgCgND/DAYgBaQEASvMzHIAYkBYAoDQ/wwGIAWkBAErzMxyAGJAWAKA0P8MBiAFpAQBK8zMcgBiQFgCgND/DAYgBaQEASvMzHIAYkBYAoDQ/wwGIAWkBAErzMxyAGJAWAKA0P8MBiAFpAQBK8zMcgBEGarWadbtda7VaKEmxAADPxG02m8ffXa1WNplMrFwup7gd/t0agP/Z878R/rm0UCjYfr+32Wzmn5iEVwxAACZMyu12AHR4Cx6Px1apVNwKc/XZAgDkQ4j0jwgApfkZDkAMSAsAUJqf4QDEgLQAAKX5GQ5ADEgLAFCan+EAxIC0AACl+RkOQAxICwBQmp/hAMSAtAAApfkZDkAMSAsAUJqf4QDEgLQAAKX5GQ5ADEgLAFCan+EAxIC0AACl+RkOQAxICwBQmp/hAMSAtAAApfkZDkAMSAsAUJqf4QDEgLQAAKX5GQ5ADEgLAFCan+EAxIC0AACl+RkOQAxICwBQmp/hAMSAtAAApfkZDkAMSAsAUJqf4QDEgLQAAKX5GQ5ADEgLAFCan+EAxIC0AACl+RkOQAxICwBQmp/hAMSAtAAApfkZDkAMSAsAUJqf4QDEgLQAAKX5GQ5ADEgLAFCan+EAxIC0AACl+Rn+G8489LeEyrWiAAAAAElFTkSuQmCC</thumbnail><scenes select="1"><scene name="Assembly"><notes></notes><palette><category name="Streams" color="164,0,0,1"/></palette><hidden></hidden><headers></headers><code></code><blocks><block-definition s="move %&apos;var2&apos; into %&apos;var1&apos; by %&apos;step1&apos; and %&apos;step2&apos; and do %&apos;stuff&apos; while %&apos;var3&apos; &gt; %&apos;value&apos;" type="command" category="other"><comment w="90" collapsed="false">Acts like MOV in assembler.</comment><header></header><code></code><translations></translations><inputs><input type="%s" initial="1">bl</input><input type="%s" initial="1">al</input><input type="%n" initial="1">1</input><input type="%n" initial="1">1</input><input type="%cmdRing" initial="1"></input><input type="%s" initial="1">cl</input><input type="%n" initial="1">0</input></inputs><script><block s="doSetVar"><l>zero</l><l>0</l></block><custom-block s="repeat while %boolUE %cs"><block s="reportVariadicGreaterThan"><list><block s="reportApplyExtension"><l>var_get(name)</l><list><block var="var3"/></list></block><block var="value"/></list></block><script><block s="doSetVar"><l>zero</l><l>0</l></block><block s="doApplyExtension"><l>var_set(name, val)</l><list><block var="var1"/><block s="reportVariadicSum"><list><block s="reportApplyExtension"><l>var_get(name)</l><list><block var="var1"/></list></block><block var="step1"/></list></block></list></block><block s="doApplyExtension"><l>var_set(name, val)</l><list><block var="var2"/><block s="reportDifference"><block s="reportApplyExtension"><l>var_get(name)</l><list><block var="var2"/></list></block><block var="step2"/></block></list></block><block s="doRun"><block var="stuff"/><list></list></block></script></custom-block><block s="doSetVar"><l>one</l><l>1</l></block></script></block-definition><block-definition s="null" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><l></l></block></script></block-definition><block-definition s="head of stream %&apos;stream&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="318.8106770833335" collapsed="false">The stream version of ITEM (1) OF.&#xD;The equivalent of SICP function STREAM-CAR.&#xD;&#xD;This block is one of five lower-level stream blocks, directly interacting with the data structure, hiding it from the higher-level stream blocks.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:o primeiro item do canal _&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="stream"/></block></block></script><scripts><script x="10" y="130.66666666666657"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="head of stream %l"><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="tail of stream %&apos;stream&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="461.81067708333336" collapsed="false">The stream version of ALL BUT FIRST OF.&#xD;The equivalent of SICP* function STREAM-CDR.&#xD;&#xD;This block is one of five lower-level stream blocks, directly interacting with the data structure, hiding it from the higher-level stream blocks. The others are: HEAD OF STREAM, IN FRONT OF STREAM, IS STREAM EMPTY?, and THE EMPTY STREAM.&#xD;&#xD;Very Short Introduction To Streams:&#xD;-----------------------------------------------&#xD;Streams, also called lazy lists, are like lists except that items are not computed until they&apos;re needed. This allows for more efficient handling of large computed lists, and even infinite lists.  The only piece of magic is in IN FRONT OF STREAM, whose second input is of type Unevaluated, which means that it&apos;s effectively a procedure, with a sort of invisible gray ring. So HEAD OF STREAM is just ITEM 1 OF, but TAIL OF STREAM has a CALL block to make the computation happen.&#xD;&#xD;For a demo of streams, try the block STREAM DEMO. Plus, each stream block has its own demo(-s), to be accessed from their respective edit windows.&#xD;&#xD;*For a tutorial introduction to streams, read Structure and Interpretation of Computer Programs (SICP), section 3.5 (at the time of writing this Help text, the full text could be read on the internet: https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/index.html); or Brian Harvey&apos;s lecture notes (start on page 74): https://people.eecs.berkeley.edu/&#126;bh/61a-pages/Volume2/notes.pdf&#xD;&#xD;As of release 2 of the Streams library, the data structure of streams was simplified, and so were TAIL OF STREAM and IN FRONT OF STREAM. Streams created with release 1 of the library (perhaps stored in a variable, or otherwise) can be used with release 2 blocks; insofar as they were already (partly) evaluated, they will be re-evaluated.</comment><header></header><code></code><translations>pt:um canal com todos os itens de _ menos o primeiro&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>promise</l></list></block><block s="doWarp"><script><block s="doIf"><block s="reportIsA"><block s="reportListItem"><l>2</l><block var="stream"/></block><l><option>script</option></l></block><script><block s="doSetVar"><l>promise</l><block s="reportListItem"><l>2</l><block var="stream"/></block></block><block s="doReplaceInList"><l>2</l><block var="stream"/><l></l></block></script><list></list></block></script></block><block s="doIfElse"><block var="promise"/><script><block s="doReplaceInList"><l>2</l><block var="stream"/><block s="evaluate"><block var="promise"/><list></list></block></block></script><script><block s="doWaitUntil"><block s="reportIsA"><block s="reportListItem"><l>2</l><block var="stream"/></block><l><option>list</option></l></block></block></script></block><block s="doReport"><block s="reportListItem"><l>2</l><block var="stream"/></block></block></script><scripts><script x="10" y="371.857142857143"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="tail of stream %l"><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></block></script><script x="10" y="435.5714285714288"><custom-block s="$speechBubble %mlt"><l>Former version of TAIL OF STREAM</l></custom-block><custom-block s="$speechBubble %mlt"><l>Formerly, the data structure of a stream consisted of 4 items:&#xD;1. The head, or 1st data item;&#xD;2. The promise, i.e. an unevaluated reporter prescribing the remainder of the stream (like DNA);&#xD;3. A Boolean indicating whether the promise was evaluated yet;&#xD;4. A link to the remainder, or tail, of the stream (if the promise was evaluated), or FALSE (otherwise).&#xD;&#xD;The current data structure is only 2 items:&#xD;1. The head, or 1st data item;&#xD;2. The promise (if not evaluated yet), or link to the tail of the stream (if the promise was evaluated).</l></custom-block><block s="doWarp"><script><block s="doIf"><block s="reportListItem"><l>3</l><block var="stream"/></block><script><block s="doReport"><block s="reportListItem"><l>4</l><block var="stream"/></block></block></script><list></list></block><block s="doReplaceInList"><l>4</l><block var="stream"/><block s="evaluate"><block s="reportListItem"><l>2</l><block var="stream"/></block><list></list></block></block><block s="doReplaceInList"><l>3</l><block var="stream"/><block s="reportBoolean"><l><bool>true</bool></l></block></block><block s="doReport"><block s="reportListItem"><l>4</l><block var="stream"/></block></block></script></block></script></scripts></block-definition><block-definition s="%&apos;head&apos; in front of stream %&apos;delayed tail&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="317.6106770833337" collapsed="false">The stream version of IN FRONT OF.&#xD;The equivalent of SICP function CONS-STREAM.&#xD;&#xD;The 2nd input parameter is of type Unevaluated. Therefore, calling IN FRONT OF STREAM causes only the first item of the new stream to be evaluated, not the rest of the stream. The latter will be performed, as required, by TAIL OF STREAM.&#xD;&#xD;This block is one of five lower-level stream blocks, directly interacting with the data structure, hiding it from the higher-level stream blocks.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:a prefixação de _ ao canal _&#xD;</translations><inputs><input type="%s"></input><input type="%anyUE"></input></inputs><script><block s="doReport"><block s="reportNewList"><list><block var="head"/><block var="delayed tail"/></list></block></block></script><scripts><script x="10" y="191.8571428571429"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><l>1</l><custom-block s="stream with numbers from %n"><l>2</l></custom-block></custom-block></block></script><script x="10" y="255.57142857142856"><custom-block s="$speechBubble %mlt"><l>Former version of IN FRONT OF STREAM</l></custom-block><block s="doReport"><block s="reportNewList"><list><block var="head"/><block var="tail"/><block s="reportBoolean"><l><bool>false</bool></l></block><block s="reportBoolean"><l><bool>false</bool></l></block></list></block></block></script></scripts></block-definition><block-definition s="comment %&apos;text&apos;" type="command" category="other"><comment x="0" y="0" w="122.00000000000001" collapsed="false">A multiline text block, that doesn’t *do* anything.</comment><header></header><code></code><translations></translations><inputs><input type="%mlt">no comment!</input></inputs></block-definition><block-definition s="the empty stream" type="reporter" category="Streams"><comment x="0" y="0" w="312.8" collapsed="false">A stream without elements.&#xD;&#xD;This block is one of five lower-level stream blocks, directly interacting with the data structure, hiding it for the higher-level stream blocks.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="THE EMPTY STREAM"/><l><option>list</option></l></block></block><script><block s="doSetVar"><l>THE EMPTY STREAM</l><block s="reportNewList"><list><l>*the empty stream*</l></list></block></block></script><list></list></block><block s="doReport"><block var="THE EMPTY STREAM"/></block></script><scripts><script x="10" y="152.71666666666678"><custom-block s="comment %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script></scripts></block-definition><block-definition s="$speechBubble %&apos;text&apos;" type="command" category="other"><comment x="0" y="0" w="122.00000000000001" collapsed="false">A multiline text block, that doesn’t *do* anything.</comment><header></header><code></code><translations></translations><inputs><input type="%mlt">no comment!</input></inputs></block-definition><block-definition s="is stream %&apos;stream&apos; empty?" type="predicate" category="Streams"><comment x="0" y="0" w="406.2" collapsed="false">Report if a stream has no elements. &#xD;The stream version of IS EMPTY?.&#xD;The equivalent of SICP function STREAM-NULL?&#xD;&#xD;A stream is considered empty only if it has been computed and is equal to THE EMPTY STREAM.  A stream that has not yet been computed (because it was made with IN FRONT OF STREAM, for example, or with a KEEP whose predicate is never satisfied, isn&apos;t empty even though it may not have any elements.&#xD;&#xD;This block is one of five lower-level stream blocks, directly interacting with the data structure, hiding it for the higher-level stream blocks.&#xD;&#xD;General Info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportVariadicIsIdentical"><list><block var="stream"/><custom-block s="the empty stream"></custom-block></list></block></block></script><scripts><script x="7.142857142857143" y="203.8571428571429"><custom-block s="comment %mlt"><l>Demo</l></custom-block><block s="doReport"><block s="reportNewList"><list><custom-block s="is stream %l empty?"><custom-block s="the empty stream"></custom-block></custom-block><custom-block s="is stream %l empty?"><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block><custom-block s="is stream %l empty?"><custom-block s="stream %mult%s"><list><l></l></list></custom-block></custom-block><custom-block s="is stream %l empty?"><custom-block s="stream %mult%s"><list></list></custom-block></custom-block></list></block></block></script><script x="7.142857142857143" y="322.7619047619048"><custom-block s="comment %mlt"><l>Demo: pathologiocal case (will not terminate)</l></custom-block><block s="doReport"><custom-block s="is stream %l empty?"><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><l></l><l>1</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="stream %&apos;items&apos;" type="reporter" category="Streams" space="true"><comment x="0" y="0" w="343.3333333333333" collapsed="false">Create a stream from a finite collection of items, like the LIST primitive.&#xD;Since this block is typically used for small amounts of data, it does not delay computation of its inputs.&#xD;&#xD;If you are using a list of all the desired values as input, make sure it is specified to be an INPUT LIST&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:um canal com _&#xD;</translations><inputs><input type="%mult%s" initial="1"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="items"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="reportListItem"><l>1</l><block var="items"/></block><custom-block s="stream %mult%s"><block s="reportCDR"><block var="items"/></block></custom-block></custom-block></block></script><scripts><script x="10" y="177.01190476190482"><custom-block s="$speechBubble %mlt"><l>Demo: specify individual stream items</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream %mult%s"><list><l>1</l><l>2</l></list></custom-block></custom-block></block></script><script x="10" y="240.72619047619042"><custom-block s="$speechBubble %mlt"><l>Demo: use an input list (list dropped on pair of arrows)</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream %mult%s"><block s="reportNumbers"><l>1</l><l>7</l></block></custom-block></custom-block></block></script><script x="10" y="319.0357142857143"><custom-block s="$speechBubble %mlt"><l>Demo: in contrast with the above, if you drop a list onto an empty slot,&#xD;it will be considered a single item (which may be what you want, but&#xD;usually you want them to be separate items, so use an input list). </l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream %mult%s"><list><block s="reportNumbers"><l>1</l><l>7</l></block></list></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="stream with numbers from %&apos;start&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="374.6106770833333" collapsed="false">The stream version of NUMBERS FROM () TO (), with no ending number because it reports the infinite stream of all the integers greater than or equal to its input.&#xD;&#xD;Read the code!  It&apos;s deceptively simple.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:um canal com os números a partir de _&#xD;</translations><inputs><input type="%n">1</input></inputs><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="start"/><custom-block s="stream with numbers from %n"><block s="reportVariadicSum"><list><block var="start"/><l>1</l></list></block></custom-block></custom-block></block></script><scripts><script x="10" y="119.85714285714279"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></block></script><script x="10" y="183.57142857142867"><custom-block s="$speechBubble %mlt"><l>Advanced version supporting both finite and infinite streams</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream with numbers from %n to %n step %n"><l>1</l><l>5</l><l>2</l></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="stream repeating %&apos;items&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="332.66666666666674" collapsed="false">Create an infinite stream repeating a finite collection of items.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:um canal com _&#xD;</translations><inputs><input type="%mult%s" initial="1"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="items"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="reportListItem"><l>1</l><block var="items"/></block><custom-block s="$gears HELPER stream repeating %l"><custom-block s="%l followed by %s"><block s="reportCDR"><block var="items"/></block><block s="reportListItem"><l>1</l><block var="items"/></block></custom-block></custom-block></custom-block></block></script><scripts><script x="7.142857142857143" y="193.72619047619045"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream repeating %mult%s"><list><l>A</l><l>b</l><l>3</l></list></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="generate stream %&apos;function&apos; %&apos;#&apos; w/seeds: %&apos;seeds&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="410.44640066964325" collapsed="false">A highly user-configurable stream generator.&#xD;&#xD;INPUT&#xD;1. Function generating new stream items;&#xD;2. Index (#) of the current item within the stream (may be used by the embedded function);&#xD;3. Seeds, i.e. first items of the stream.&#xD;&#xD;HOW IT WORKS&#xD;E.g. with 2 seeds: when generating item 3, items 1 and 2 are inserted into the 1st and 2nd empty slot, repectively, of the embedded function. When item 4 is generated, items 2 and 3 are inserted … (etc.)&#xD;&#xD;RESULT&#xD;An infinite stream. Open the block editor for an example.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAMS.</comment><header></header><code></code><translations>pt:um canal com os números a partir de _&#xD;</translations><inputs><input type="%repRing">1</input><input type="%upvar"></input><input type="%mult%s"></input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>function*</l><custom-block s="substitute vars %s"><block var="function"/></custom-block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>seeds*</l><block s="reportMonadic"><l><option>id</option></l><block var="seeds"/></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>generate</l><block s="reifyScript"><script><custom-block s="let %upvar $arrowLeft %s"><l>head</l><block s="evaluate"><block s="reportAttributeOf"><block var="function*"/><block s="reportEnvironment"><l><option>script</option></l></block></block><block var="seeds*"/></block></custom-block><block s="doSetVar"><l>seeds*</l><block s="reportCDR"><custom-block s="%l followed by %s"><block var="seeds*"/><block var="head"/></custom-block></block></block><block s="doChangeVar"><l>#</l><l>1</l></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="head"/><block s="evaluate"><block var="generate"/><list></list></block></custom-block></block></script><list></list></block></custom-block><block s="doSetVar"><l>#</l><block s="reportVariadicSum"><list><block s="reportListAttribute"><l><option>length</option></l><block var="seeds"/></block><l>1</l></list></block></block><block s="doReport"><custom-block s="append streams %mult%anyUE"><list><custom-block s="stream %mult%s"><block var="seeds"/></custom-block><block s="evaluate"><block var="generate"/><list></list></block></list></custom-block></block></script><scripts><script x="10" y="317.5714285714286"><custom-block s="$speechBubble %mlt"><l>Demo: the Fibonacci sequence</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l></l></list></block></autolambda><list></list></block><l>#</l><list><l>1</l><l>1</l></list></custom-block></custom-block></block></script><script x="10" y="404.7142857142855"><custom-block s="$speechBubble %mlt"><l>Demo: squares</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><block var="#"/></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="map %&apos;function&apos; over stream(s) %&apos;streams&apos;" type="reporter" category="Streams" space="true"><comment x="0" y="0" w="290.2106770833335" collapsed="false">The stream version of variadic MAP (any number of input streams, like MULTMAP in the List utilities library).&#xD;&#xD;All input streams must be either infinite or of the same length.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:a aplicação de _ aos itens dos canais _&#xD;</translations><inputs><input type="%repRing"></input><input type="%mult%l" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block s="reportListItem"><l>1</l><block var="streams"/></block></custom-block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="evaluate"><block var="function"/><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="head of stream %l"><l/></custom-block></autolambda><list></list></block><block var="streams"/></block></block><custom-block s="map %repRing over stream(s) %mult%l"><block var="function"/><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="tail of stream %l"><l/></custom-block></autolambda><list></list></block><block var="streams"/></block></custom-block></custom-block></block></script><scripts><script x="10" y="231.91666666666666"><custom-block s="$speechBubble %mlt"><l>Demo, 1 input stream</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><l></l><l></l></list></block></autolambda><list></list></block><list><custom-block s="stream with numbers from %n"><l>1</l></custom-block></list></custom-block></custom-block></block></script><script x="10" y="334.75000000000006"><custom-block s="$speechBubble %mlt"><l>Demo, 2 input streams</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><l></l><l></l></list></block></autolambda><list></list></block><list><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="stream with numbers from %n"><l>11</l></custom-block></list></custom-block></custom-block></block></script><script x="10" y="455.5833333333335"><custom-block s="$speechBubble %mlt"><l> Demo of an integrated version of MAP and KEEP.</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><block s="reportListAttribute"><l><option>reverse</option></l><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="square %n"><l></l></custom-block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script><script x="10" y="612.4166666666667"><custom-block s="$speechBubble %mlt"><l>As of v2 of the Streams library, the block below is obsolete.&#xD;It is kept as a hidden block for upward compatibility with v1.</l></custom-block><custom-block s="$speechBubble %mlt"><custom-block s="map %repRing over stream %mult%l"><block s="reifyReporter"><script></script><list></list></block><list><l/></list></custom-block></custom-block></script></scripts></block-definition><block-definition s="%&apos;variable&apos; $arrowLeft %&apos;value&apos;" type="reporter" category="variables"><comment x="0" y="0" w="94.80000000000001" collapsed="false">Create, and at once initialize, and report, a local variable.</comment><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>variable</l><block var="value"/></block><block s="doReport"><block var="variable"/></block></script></block-definition><block-definition s="flatmap %&apos;function&apos; over stream(s) %&apos;streams&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="344.43169642857157" collapsed="false">Like MAP OVER STREAM(S), but it flattens the result (one level). That is, it requires its first input to be a function that reports a stream, so that MAP would report a stream of streams.  FLATMAP reports a stream whose items are *the items of* the streams reported by that function.&#xD;&#xD;FLATMAP for lists is typically defined using APPEND to join the items of the sublists.  Since streams can be infinite, the substreams can&apos;t be appended.  Instead, FLATMAP uses INTERLEAVE STREAMS to combine the items of the substreams.  Therefore, the order of items in the result is not guaranteed.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%mult%l" initial="1"></input></inputs><script><block s="doReport"><custom-block s="$gears flatten stream %l"><custom-block s="map %repRing over stream(s) %mult%l"><block var="function"/><block var="streams"/></custom-block></custom-block></block></script><scripts><script x="7.142857142857143" y="179.8571428571429"><custom-block s="$speechBubble %mlt"><l>Demo: all positive rationals</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="flatmap %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l>/</l><block var="denominator"/></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><custom-block s="GCD (or) %n $∨-1.2-255-255-0 %n"><l></l><block var="denominator"/></custom-block><l>1</l></list></block></autolambda><list></list></block><block s="reifyReporter"><script></script><list></list></block><custom-block s="stream with numbers from %n"><block var="denominator"/></custom-block></custom-block></autolambda><list><l>denominator</l></list></block><list><custom-block s="stream with numbers from %n"><l>1</l></custom-block></list></custom-block></custom-block></block></script><script x="7.142857142857143" y="380.8571428571426"><custom-block s="$speechBubble %mlt"><l>Advanced version, more balanced output</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="$crosshairs flatmap %repRing over stream %l"><block s="reifyReporter"><autolambda><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l>/</l><block var="denominator"/></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><custom-block s="GCD (or) %n $∨-1.2-255-255-0 %n"><l></l><block var="denominator"/></custom-block><l>1</l></list></block></autolambda><list></list></block><block s="reifyReporter"><script></script><list></list></block><custom-block s="stream with numbers from %n"><block var="denominator"/></custom-block></custom-block></autolambda><list><l>denominator</l></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script><script x="7.142857142857143" y="583.9761904761895"><custom-block s="$speechBubble %mlt"><l>A variety of flatmap working for finite substreams only</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="flatmap finite %repRing over stream %l"><block s="reifyReporter"><autolambda><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportNewList"><list><block var="#1"/><block var="#2"/></list></block></autolambda><list><l>#1</l></list></block><list><custom-block s="stream with numbers from %n to %n step %n"><l>1</l><block var="#2"/><l>1</l></custom-block></list></custom-block></autolambda><list><l>#2</l></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="map %&apos;function A&apos; over keep %&apos;pred&apos; from map %&apos;function B&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="297.8271484375" collapsed="false">A stream version of Python’s list comprehension, with an extra twist. It runs faster than KEEP from MAP, and MAP over KEEP (and MAP over KEEP from MAP, of course).&#xD;&#xD;- For MAP over KEEP from MAP, use all slots;&#xD;- If all you need is MAP over KEEP, leave the third slot empty. &#xD;- For KEEP from MAP, leave the first slot empty. &#xD;- For MAP over MAP (really?), make the second slot TRUE. &#xD;- For KEEP from MAP over KEEP, use an extra KEEP block.&#xD;- (etc.)&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%predRing"></input><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="function A"/><block s="reifyReporter"><script></script><list></list></block></list></block><script><block s="doReport"><custom-block s="keep %predRing from map %repRing over stream %l"><block var="pred"/><block var="function B"/><block var="stream"/></custom-block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="function B"/><block s="reifyReporter"><script></script><list></list></block></list></block><script><block s="doReport"><custom-block s="map %repRing over keep %predRing from stream %l"><block var="function A"/><block var="pred"/><block var="stream"/></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="$gears HELPER map %repRing over keep %predRing from map %repRing over stream %l"><block var="function A"/><block var="pred"/><block var="function B"/><block var="stream"/></custom-block></block></script><scripts><script x="10" y="267.3809523809524"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><block s="reportListAttribute"><l><option>reverse</option></l><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="square %n"><l></l></custom-block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script><script x="10" y="418.5476190476185"><custom-block s="$speechBubble %mlt"><l>Demo: MAP OVER KEEP</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><block s="reportListAttribute"><l><option>reverse</option></l><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></autolambda><list></list></block><block s="reifyReporter"><script></script><list></list></block><custom-block s="stream with numbers from %n"><l>15</l></custom-block></custom-block></custom-block></block></script><script x="10" y="569.7142857142843"><custom-block s="$speechBubble %mlt"><l>Demo: KEEP OVER MAP</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><script></script><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="square %n"><l></l></custom-block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="keep items %&apos;pred&apos; from stream %&apos;stream&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="292.4223958333333" collapsed="false">The stream version of KEEP.&#xD;&#xD;WARNING: If the predicate is such that, beyond a certain point, no other item will ever pass the test, a search with KEEP will not terminate. In such cases, use SEGMENT OF STREAM.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:os itens tais que _ do canal _&#xD;</translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doUntil"><block s="evaluate"><block var="pred"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block><script><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block></script></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="keep items %predRing from stream %l"><block var="pred"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></block></script><scripts><script x="10" y="314.00000000000006"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><block s="reportModulus"><l></l><l>2</l></block><l>0</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script><script x="10" y="427.99999999999983"><custom-block s="$speechBubble %mlt"><l> Demo of an integrated version of MAP and KEEP</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><block s="reportListAttribute"><l><option>reverse</option></l><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><block s="reportTextSplit"><l></l><l><option>letter</option></l></block></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="square %n"><l></l></custom-block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="keep %&apos;pred&apos; from map %&apos;function&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%predRing"></input><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><custom-block s="%upvar $arrowLeft %s"><l>map result</l><block s="evaluate"><block var="function"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block></custom-block></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="map result"/><custom-block s="keep %predRing from map %repRing over stream %l"><block var="pred"/><block var="function"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></block></script><script><block s="doReport"><custom-block s="keep %predRing from map %repRing over stream %l"><block var="pred"/><block var="function"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></block></script></block></script><scripts><script x="7.142857142857143" y="334.7738095238096"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><l></l></block></script></scripts></block-definition><block-definition s="ignore %&apos;x&apos;" type="command" category="control"><comment x="0" y="0" w="206.66666666666666" collapsed="false">This block does nothing.&#xD;Use it when you are calling a reporter&#xD;for its side effect and don&apos;t care about&#xD;its return value.</comment><header></header><code></code><translations>de:ignoriere _&#xD;ca:ignora _&#xD;es:ignorar _&#xD;fr:ignore _&#xD;pt:ignora _&#xD;pl:ignoruj _&#xD;</translations><inputs><input type="%s"></input></inputs></block-definition><block-definition s="delay %&apos;expression&apos; by %&apos;time&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%anyUE" initial="1"></input><input type="%n" initial="1">1</input></inputs><script><block s="doWait"><block var="time"/></block><block s="doReport"><block s="evaluate"><block var="expression"/><list></list></block></block></script></block-definition><block-definition s="%&apos;data&apos; followed by %&apos;value&apos;" type="reporter" category="lists"><comment x="0" y="0" w="187.00000000000003" collapsed="false">The counterpart of IN FRONT OF: returns the first input attached at the back end of the list that is the second input</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportConcatenatedLists"><list><block var="data"/><block s="reportNewList"><list><block var="value"/></list></block></list></block></block></script></block-definition><block-definition s="let %&apos;variable&apos; $arrowLeft %&apos;value&apos;" type="command" category="variables"><comment x="0" y="0" w="256.9999999999998" collapsed="true">Declare and at once intialize a local variable</comment><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>variable</l><block var="value"/></block></script></block-definition><block-definition s="map %&apos;function&apos; over keep %&apos;pred&apos; from stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="evaluate"><block var="function"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block><custom-block s="map %repRing over keep %predRing from stream %l"><block var="function"/><block var="pred"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></block></script><script><block s="doReport"><custom-block s="map %repRing over keep %predRing from stream %l"><block var="function"/><block var="pred"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></block></script></block></script><scripts><script x="7.14285714285711" y="286.98809523809535"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><l></l></block></script></scripts></block-definition><block-definition s="· %&apos;x&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%anyUE"></input></inputs></block-definition><block-definition s="first item+index %&apos;pred&apos; from stream %&apos;stream&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="313.7142857142858" collapsed="false">A combination of FIND FIRST ITEM and INDEX OF, for streams.&#xD;&#xD;INPUTS:  1. condition to be satisfied by item; 2. stream to be searched.&#xD;RESULT: a list of two values: 1. item’s value; 2. index of item within the stream.&#xD;&#xD;If no item within a finite stream satisfies the condition, &quot;&quot; is reported.&#xD;If no item within an *infinite* stream satisfies the condition, the search will not terminate (to prevent this, limit the size of the input stream using SEGMENT OF STREAM).&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAMS.</comment><header></header><code></code><translations></translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>index</l><l>1</l></custom-block><block s="doUntil"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doIf"><block s="evaluate"><block var="pred"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block><script><block s="doReport"><block s="reportNewList"><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><block var="index"/></list></block></block></script><list></list></block><block s="doChangeVar"><l>index</l><l>1</l></block><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block></script></block><block s="doReport"><l></l></block></script><scripts><script x="7.142857142857143" y="264.7499999999999"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="first item+index %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><l></l><l>20</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>10</l></custom-block></custom-block></block></script><script x="7.142857142857143" y="351.89285714285694"><custom-block s="$speechBubble %mlt"><l>Demo: not terminating (press the red stop button)</l></custom-block><block s="doReport"><custom-block s="first item+index %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><l></l><l>0</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>10</l></custom-block></custom-block></block></script><script x="7.142857142857143" y="439.0357142857137"><custom-block s="$speechBubble %mlt"><l>Demo: terminating because of search limit</l></custom-block><block s="doReport"><custom-block s="first item+index %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><l></l><l>0</l></list></block></autolambda><list></list></block><custom-block s="segment of stream %l %br starting with first item that %predRing %br ending with next item that %predRing inclusive? %b"><custom-block s="stream with numbers from %n"><l>10</l></custom-block><block s="reifyPredicate"><script></script><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><block var="idx"/><l>100</l></list></block></autolambda><list><l>val</l><l>idx</l></list></block><l><bool>false</bool></l></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$gears HELPER map %&apos;function A&apos; over keep %&apos;pred&apos; from map %&apos;function B&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%predRing"></input><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><custom-block s="%upvar $arrowLeft %s"><l>intermediate</l><block s="evaluate"><block var="function B"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block></custom-block></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="evaluate"><block var="function A"/><list><block var="intermediate"/></list></block><custom-block s="$gears HELPER map %repRing over keep %predRing from map %repRing over stream %l"><block var="function A"/><block var="pred"/><block var="function B"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></block></script><script><block s="doReport"><custom-block s="$gears HELPER map %repRing over keep %predRing from map %repRing over stream %l"><block var="function A"/><block var="pred"/><block var="function B"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></block></script></block></script></block-definition><block-definition s="list %&apos;requested&apos; items with %&apos;downstream&apos; of stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="467.05111607142857" collapsed="false">Report a specified number of items from a stream as a list. The “delayed continuation”, starting immediately after the last of the reported items, is made available as an upvar (see inside for demo of continuation; be careful not to use the same identifier for input and upvar continuations).&#xD;&#xD;Replaces SHOW STREAM from version 1 of this library.&#xD;&#xD;The inputs are an integer and a stream. With a positive integer, LIST ... STREAM reports a regular finite list of length less than (for short finite streams) or equal to the integer. It&apos;s useful because an infinite stream can&apos;t be displayed in a finite amount of time.&#xD;&#xD;Alternatively, ”all” (or “Infinity”) may be used as first input, for the showing to continue until the end of the stream will have been reached. Better not try this with infinite streams: the process may never terminate!&#xD;&#xD;Another cause of not terminating:&#xD;1. the input stream is part of a chain of streams AND&#xD;2. the number of elements of the input stream is less than the number of items specified to be reported AND&#xD;3. the first stream of the input chain is infinite.&#xD;For example: LIST ( 10 ) ITEMS OF STREAM ( KEEP ITEMS SUCH THAT ( _ &lt; 5 ) FROM STREAM ( STREAM WITH NUMBERS FROM ( 1 ) ) ).&#xD;Explanation: after the first 4 items, LIST ( 10 ) ITEMS OF STREAM will keep on asking for more input, and STREAM WITH NUMBERS FROM ( 1 ) will keep generating new items forever, each of which will be discarded by KEEP ITEMS SUCH THAT ( _ &lt; 5 ) FROM STREAM, which is the middle part of the chain.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%n" initial="1">10<options>all=Infinity</options></input><input type="%upvar" initial="1"></input><input type="%l" initial="1"></input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>items</l><block s="reportNewList"><list></list></block></custom-block><block s="doUntil"><block s="reportVariadicOr"><list><block s="reportVariadicLessThan"><list><block var="requested"/><l>1.5</l></list></block><custom-block s="is stream %l empty?"><block var="stream"/></custom-block></list></block><script><block s="doAddToList"><custom-block s="head of stream %l"><block var="stream"/></custom-block><block var="items"/></block><block s="doChangeVar"><l>requested</l><l>-1</l></block><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block></script></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doSetVar"><l>downstream</l><custom-block s="delay %anyUE by %n"><custom-block s="the empty stream"></custom-block><l></l></custom-block></block><block s="doReport"><block var="items"/></block></script><list></list></block><block s="doSetVar"><l>downstream</l><custom-block s="delay %anyUE by %n"><custom-block s="tail of stream %l"><block var="stream"/></custom-block><l></l></custom-block></block><block s="doReport"><custom-block s="%l followed by %s"><block var="items"/><custom-block s="head of stream %l"><block var="stream"/></custom-block></custom-block></block></script><scripts><script x="10" y="364.15476190476176"><custom-block s="comment %mlt"><l>Demo of primary output</l></custom-block><block s="doReport"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>downstream</l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></block></script><script x="10" y="445.8928571428566"><custom-block s="comment %mlt"><l>Demo of downstream, be careful to use CALL.</l></custom-block><custom-block s="ignore %s"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>downstream</l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block><custom-block s="ignore %s"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>downstream</l><block s="evaluate"><block var="downstream"/><list></list></block></custom-block></custom-block><block s="doReport"><custom-block s="list %n items with %upvar of stream %l"><l>5</l><l>downstream</l><block s="evaluate"><block var="downstream"/><list></list></block></custom-block></block></script></scripts></block-definition><block-definition s="incrementally combine stream %&apos;stream&apos; $nl using %&apos;combiner&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="409.68571428571425" collapsed="false">This is the stream version of the COMBINE block for lists.&#xD;&#xD;Since lists are finite, it&apos;s always possible to combine *all* items of a list.  For example, given a list of numbers, it&apos;s possible to add all the numbers and report a single number, the sum.&#xD;&#xD;Since a stream can be infinite, it&apos;s not, in general, possible to combine all its items.  Instead, this block reports a stream.  The first item of the result stream is the first item of the input stream; the second item of the result stream is the result of combining the first two items of the input; the third item is the result of combining the first three items; and so on.&#xD;&#xD;INPUTS:&#xD;1. input stream&#xD;2. combiner (function)&#xD;&#xD;RESULT&#xD;A stream. The first element is the head of the input stream. Each following element is calculated by applying the combiner on the preceding *result* item and the value of the current /input/ item:&#xD;&#xD;result (i) = combiner (result (i-1), input (i)).&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%repRing"></input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>combined</l><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="map %repRing over stream(s) %mult%l"><block var="combiner"/><list><block var="combined"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></list></custom-block></custom-block></custom-block><block s="doReport"><block var="combined"/></block></script><scripts><script x="10" y="311.85714285714283"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>5</l><custom-block s="incrementally combine stream %l %br using %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l></l></list></block></autolambda><list></list></block></custom-block></custom-block></block></script><script x="10" y="416.9999999999997"><custom-block s="$speechBubble %mlt"><l>Demo: advanced, and somewhat faster, version</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>5</l><custom-block s="$flash integrate %repRing with precursor %s over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l></l></list></block></autolambda><list></list></block><l></l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="stream with numbers from %&apos;start&apos; to %&apos;end&apos; step %&apos;step&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations>pt:um canal com os números a partir de _&#xD;</translations><inputs><input type="%n">1</input><input type="%n" initial="1">Infinity<options>Infinity</options></input><input type="%n" initial="1">1</input></inputs><script><block s="doIf"><block s="reportVariadicGreaterThan"><list><block s="reportVariadicProduct"><list><block s="reportDifference"><block var="start"/><block var="end"/></block><block var="step"/></list></block><l>0</l></list></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="start"/><custom-block s="stream with numbers from %n to %n step %n"><block s="reportVariadicSum"><list><block var="start"/><block var="step"/></list></block><block var="end"/><block var="step"/></custom-block></custom-block></block></script><scripts><script x="10" y="219.58333333333337"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>downstream</l><custom-block s="stream with numbers from %n to %n step %n"><l>1</l><l>5</l><l>0.5</l></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="uniques of stream %&apos;stream&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="297.604743303572" collapsed="false">The stream version of UNIQUES OF (list).&#xD;&#xD;This implementation though elegant is unsuitable for large data. Edit the block to find a faster but less elegant version.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="uniques of stream %l"><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicNotEquals"><list><l></l><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block></autolambda><list></list></block><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></custom-block></block></script><scripts><script x="7.142857142857143" y="230.22619047619048"><custom-block s="$speechBubble %mlt"><l>Demo: from a stream of random integers, UNIQUES OF STREAM picks just the “new” ones.</l></custom-block><block s="doReport"><block s="reportListAttribute"><l><option>sorted</option></l><custom-block s="list %n items of stream %l"><l>30</l><custom-block s="uniques of stream %l"><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportRandom"><l>1</l><l>30</l></block></autolambda><list></list></block><l>#</l><list></list></custom-block></custom-block></custom-block></block></block></script><script x="7.142857142857143" y="361.2738095238094"><custom-block s="$speechBubble %mlt"><l>Demo of a somewhat less elegant, yet faster implementation of UNIQUES OF STREAM&#xD;(edit to see how it works). Also, the defintion of uniqueness may be specified.</l></custom-block><block s="doReport"><block s="reportListAttribute"><l><option>sorted</option></l><custom-block s="list %n items of stream %l"><l>30</l><custom-block s="$flash uniques by %predRing latest 1st? %b of stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicNotEquals"><list><l></l><l></l></list></block></autolambda><list></list></block><l><bool>false</bool></l><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportRandom"><l>1</l><l>30</l></block></autolambda><list></list></block><l>#</l><list></list></custom-block></custom-block></custom-block></block></block></script></scripts></block-definition><block-definition s="map %&apos;function&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="181.33333333333334" collapsed="false">As of v2 of the Streams library, this block is obsolete (kept as a hidden block for upward compatibility from v1).</comment><header></header><code></code><translations>pt:a aplicação de _ aos itens dos canais _&#xD;</translations><inputs><input type="%repRing"></input><input type="%mult%l" initial="1"></input></inputs><script><block s="doReport"><custom-block s="map %repRing over stream(s) %mult%l"><block var="function"/><block var="stream"/></custom-block></block></script></block-definition><block-definition s="substitute vars %&apos;lambda&apos;" type="reporter" category="variables"><comment x="0" y="0" w="292.8571428571426" collapsed="true">Replace any variable from the caller scope with its value</comment><header></header><code></code><translations></translations><inputs><input type="%s">lambda</input></inputs><script><block s="doReport"><block s="reportJoinWords"><custom-block s="$gears substitute vars %s %s %s"><block s="reportTextSplit"><block var="lambda"/><l><option>blocks</option></l></block><block s="reportEnvironment"><l><option>caller</option></l></block><block s="reportAttributeOf"><block s="reifyReporter"><autolambda><block s="reportEnvironment"><l><option>caller</option></l></block></autolambda><list></list></block><block s="reportEnvironment"><l><option>caller</option></l></block></block></custom-block></block></block></script></block-definition><block-definition s="$gears substitute vars %&apos;blocks&apos; %&apos;internal scope&apos; %&apos;external scope&apos;" type="reporter" category="variables" helper="true"><comment x="0" y="0" w="152.0238095238095" collapsed="false">Replace any variable from the second scope, whose name is not used for a variable within the first scope, with its value.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="blocks"/><l><option>list</option></l></block></block><script><block s="doReport"><block var="blocks"/></block></script><list></list></block><custom-block s="let %upvar $arrowLeft %s"><l>var name</l><block s="reportListItem"><l>2</l><block var="blocks"/></block></custom-block><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><block var="blocks"/></block><block s="reifyReporter"><autolambda><block var=" "/></autolambda><list></list></block></list></block><block s="reportListContainsItem"><block s="reportAttributeOf"><l><option>variables</option></l><block var="external scope"/></block><block var="var name"/></block><block s="reportNot"><block s="reportListContainsItem"><block s="reportAttributeOf"><l><option>variables</option></l><block var="internal scope"/></block><block var="var name"/></block></block></list></block><script><block s="doReport"><custom-block s="blockify %l"><custom-block s="get var %s %s"><block var="var name"/><block var="external scope"/></custom-block></custom-block></block></script><list></list></block><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="$gears substitute vars %s %s %s"><l></l><block var="internal scope"/><block var="external scope"/></custom-block></autolambda><list></list></block><block var="blocks"/></block></block></script></block-definition><block-definition s="get var %&apos;name&apos; %&apos;ctx&apos;" type="reporter" category="variables" helper="true"><header></header><code></code><translations></translations><inputs><input type="%s">name</input><input type="%s">ctx</input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportAttributeOf"><block s="reportJoinWords"><block s="reportNewList"><list><block s="reifyReporter"><autolambda><block var=" "/></autolambda><list></list></block><block var="name"/></list></block></block><block var="ctx"/></block><list></list></block></block></script></block-definition><block-definition s="blockify %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportIsA"><block var="data"/><l><option>list</option></l></block><block s="reportJoinWords"><list><block s="reifyReporter"><autolambda><block s="reportNewList"><list></list></block></autolambda><list></list></block><block s="reportCONS"><block s="reportListAttribute"><l><option>length</option></l><block var="data"/></block><block s="reportMap"><block s="reportEnvironment"><l><option>script</option></l></block><block var="data"/></block></block></list></block><block s="reportIfElse"><block s="reportIsA"><block var="data"/><l><option>Boolean</option></l></block><block s="reportJoinWords"><list><block s="reifyPredicate"><autolambda><block s="reportBoolean"><l><bool>true</bool></l></block></autolambda><list></list></block><block var="data"/></list></block><block s="reportIfElse"><block s="reportIsA"><block var="data"/><l><option>script</option></l></block><block s="reportJoinWords"><list><block s="reifyReporter"><autolambda><block s="reifyReporter"><script></script><list></list></block></autolambda><list></list></block><block var="data"/></list></block><block var="data"/></block></block></block></block></script></block-definition><block-definition s="$gears segment of stream %&apos;stream&apos; once %&apos;start condition&apos; until %&apos;end condition&apos; inclusive? %&apos;include&apos; index %&apos;index&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%predRing" initial="1"></input><input type="%predRing"></input><input type="%b" initial="1">false</input><input type="%s" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doIf"><block s="evaluate"><block var="start condition"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><block var="index"/></list></block><script><block s="doReport"><custom-block s="$gears copy stream %l until %predRing inclusive? %b index %s"><block var="stream"/><block var="end condition"/><block var="include"/><l>1</l></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="$gears segment of stream %l once %predRing until %predRing inclusive? %b index %s"><custom-block s="tail of stream %l"><block var="stream"/></custom-block><block var="start condition"/><block var="end condition"/><block var="include"/><block s="reportVariadicSum"><list><block var="index"/><l>1</l></list></block></custom-block></block></script><scripts><script x="10" y="719.1666666666666"><custom-block s="$speechBubble %mlt"><l>By contrast, a version of the above with KEEP&#xD;will not terminate (use red button to stop manually).</l></custom-block><block s="doReport"><l></l></block></script><script x="10" y="791.1666666666666"><custom-block s="$speechBubble %mlt"><l>Demo using the index of each item in the halt condition,&#xD;and not including the final item: (3, 4, 5, 6)</l></custom-block><block s="doReport"><l></l></block></script></scripts></block-definition><block-definition s="$gears copy stream %&apos;stream&apos; until %&apos;end condition&apos; inclusive? %&apos;include&apos; index %&apos;index&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%predRing"></input><input type="%b" initial="1">false</input><input type="%s" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doIf"><block s="reportNot"><block s="evaluate"><block var="end condition"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><block var="index"/></list></block></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="$gears copy stream %l until %predRing inclusive? %b index %s"><custom-block s="tail of stream %l"><block var="stream"/></custom-block><block var="end condition"/><block var="include"/><block s="reportVariadicSum"><list><block var="index"/><l>1</l></list></block></custom-block></custom-block></block></script><list></list></block><block s="doIf"><block var="include"/><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="the empty stream"></custom-block></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><scripts><script x="10" y="719.1666666666666"><custom-block s="$speechBubble %mlt"><l>By contrast, a version of the above with KEEP&#xD;will not terminate (use red button to stop manually).</l></custom-block><block s="doReport"><l></l></block></script><script x="10" y="791.1666666666666"><custom-block s="$speechBubble %mlt"><l>Demo using the index of each item in the halt condition,&#xD;and not including the final item: (3, 4, 5, 6)</l></custom-block><block s="doReport"><l></l></block></script></scripts></block-definition><block-definition s="$flash uniques by %&apos;comparator&apos; latest 1st? %&apos;latest 1st&apos; of stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="363.8571428571429" collapsed="false">Reports &quot;unique&quot; items from a stream. An item&apos;s unicity is defined as it satisfying the specified condition (&quot;comparator&quot;) against any of the earlier reported items.&#xD;&#xD;Within the comparator, the first empty slot denotes the current item, the second empty slot denotes any of the earlier reported items.&#xD;&#xD;With the comparator ring left empty, the default comparator is _ ≠ _.&#xD;&#xD;If the switch “latest 1st” is true, each input item is compared with the latest of all earlier results, then with the second latest, and so on. If the switch is false, the first cimparison will be with the oldest of all earlier results. Though this will not influence nthe outcome, one of the approaches is probably faster.</comment><header></header><code></code><translations></translations><inputs><input type="%predRing" initial="1"></input><input type="%b" initial="1">true</input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="$gears HELPER $flash uniques by %predRing of stream %l %l %repRing"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block var="comparator"/><block s="reifyPredicate"><script></script><list></list></block></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicNotEquals"><list><l></l><l></l></list></block></autolambda><list></list></block><block var="comparator"/></block><block var="stream"/><block s="reportNewList"><list></list></block><block s="reportIfElse"><block var="latest 1st"/><block s="reifyReporter"><autolambda><block s="reportCONS"><l></l><l/></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="%s following %l"><l></l><l/></custom-block></autolambda><list></list></block></block></custom-block></block></script><scripts><script x="7.142857142857143" y="191.8571428571429"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><block s="reportListAttribute"><l><option>sorted</option></l><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="$flash uniques by %predRing latest 1st? %b of stream %l"><block s="reifyPredicate"><script></script><list></list></block><l><bool>true</bool></l><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportRandom"><l>1</l><l>10</l></block></autolambda><list></list></block><l>#</l><list></list></custom-block></custom-block></custom-block></block></block></script><script x="7.142857142857143" y="328.3095238095242"><custom-block s="$speechBubble %mlt"><l>Demo: only new record highs - note the comparator!</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="$flash uniques by %predRing latest 1st? %b of stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><l></l><l></l></list></block></autolambda><list></list></block><l><bool>true</bool></l><custom-block s="stream %mult%s"><list><l>3</l><l>1</l><l>5</l><l>6</l><l>7</l><l>6</l><l>7</l><l>9</l><l>8</l></list></custom-block></custom-block></custom-block></block></script><script x="7.142857142857143" y="433.4523809523809"><custom-block s="$speechBubble %mlt"><l>Demo: alternative implementation of SIEVE.&#xD;For efficiency, each input item is compared with the oldest of earlier results (= 2) first.</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>100</l><custom-block s="$flash uniques by %predRing latest 1st? %b of stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicNotEquals"><list><block s="reportModulus"><l></l><l></l></block><l>0</l></list></block></autolambda><list></list></block><l><bool>false</bool></l><custom-block s="stream with numbers from %n"><l>2</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$gears HELPER $flash uniques by %&apos;comparator&apos; of stream %&apos;stream&apos; %&apos;history&apos; %&apos;appender&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%predRing" initial="1"></input><input type="%l"></input><input type="%l"></input><input type="%repRing" initial="1">true</input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doUntil"><block s="reportVariadicEquals"><list><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportNot"><block s="evaluate"><block var="comparator"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><l></l></list></block></block></autolambda><list></list></block><block var="history"/></block><l></l></list></block><script><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block></script></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="$gears HELPER $flash uniques by %predRing of stream %l %l %repRing"><block var="comparator"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block><block s="evaluate"><block var="appender"/><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><block var="history"/></list></block><block var="appender"/></custom-block></custom-block></block></script></block-definition><block-definition s="$flash integrate %&apos;combiner&apos; with precursor %&apos;precursor&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="113.57142857142865" collapsed="false">An advanced version of INCREMENTALLY COMBINE. The functional difference isi the “precursor”, the would-be item (0) of the result stream.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing" initial="1"></input><input type="%s" initial="1"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="%upvar $arrowLeft %s"><l>head</l><block s="evaluate"><block var="combiner"/><list><block var="precursor"/><custom-block s="head of stream %l"><block var="stream"/></custom-block></list></block></custom-block><custom-block s="$flash integrate %repRing with precursor %s over stream %l"><block var="combiner"/><block var="head"/><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></block></script><scripts><script x="7.142857142857143" y="246.24999999999997"><custom-block s="$speechBubble %mlt"><l>Demo: advanced, and somewhat faster, version</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>5</l><custom-block s="$flash integrate %repRing with precursor %s over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l></l></list></block></autolambda><list></list></block><l>A.</l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="append streams %&apos;streams&apos;" type="reporter" category="Streams" space="true"><comment x="0" y="0" w="179.46770833333343" collapsed="false">Append any number of streams.&#xD;&#xD;To be used only if all streams but the last are finite; otherwise use INTERLEAVE STREAMS.&#xD;&#xD;General info in streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%mult%anyUE" initial="2"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block s="reportCDR"><block var="streams"/></block></block><script><block s="doReport"><block s="reportIfElse"><block s="reportListIsEmpty"><block var="streams"/></block><custom-block s="the empty stream"></custom-block><block s="evaluate"><block s="reportListItem"><l>1</l><block var="streams"/></block><list></list></block></block></block></script><list><custom-block s="is stream %l empty?"><custom-block s="%upvar $arrowLeft %s"><l>first</l><block s="evaluate"><block s="reportListItem"><l>1</l><block var="streams"/></block><list></list></block></custom-block></custom-block><script><block s="doReport"><custom-block s="append streams %mult%anyUE"><block s="reportCDR"><block var="streams"/></block></custom-block></block></script></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="first"/></custom-block><custom-block s="append streams %mult%anyUE"><block s="reportCONS"><custom-block s="delay %anyUE by %n"><custom-block s="tail of stream %l"><block var="first"/></custom-block><l></l></custom-block><block s="reportCDR"><block var="streams"/></block></block></custom-block></custom-block></block></script><scripts><script x="13.333333333333307" y="437.25000000000017"><custom-block s="$speechBubble %mlt"><l>An example with several input streams</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="append streams %mult%anyUE"><list><custom-block s="the empty stream"></custom-block><custom-block s="stream %mult%s"><list><l>1</l><l>2</l><l>3</l></list></custom-block><custom-block s="stream %mult%s"><list><l>11</l></list></custom-block><custom-block s="stream with numbers from %n"><l>21</l></custom-block></list></custom-block></custom-block></block></script><script x="12.666666666666679" y="321.0833333333333"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="append streams %mult%anyUE"><list><custom-block s="stream %mult%s"><list><l>1</l><l>2</l><l>3</l></list></custom-block><custom-block s="stream with numbers from %n"><l>11</l></custom-block></list></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$crosshairs flatmap %&apos;function&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="293.003125" collapsed="false">A variation of FLATMAP delivering a more even distribution of output items over mapped substreams.&#xD;Applicable only if function (input 1) will create streams.&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="$crosshairs flatten stream %l"><custom-block s="map %repRing over stream(s) %mult%l"><block var="function"/><list><block var="stream"/></list></custom-block></custom-block></block></script><scripts><script x="10" y="103"><custom-block s="$speechBubble %mlt"><l>Demo: all positive rationals</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="$crosshairs flatmap %repRing over stream %l"><block s="reifyReporter"><autolambda><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l>/</l><block var="denominator"/></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><custom-block s="GCD (or) %n $∨-1.2-255-255-0 %n"><l></l><block var="denominator"/></custom-block><l>1</l></list></block></autolambda><list></list></block><block s="reifyReporter"><script></script><list></list></block><custom-block s="stream with numbers from %n"><block var="denominator"/></custom-block></custom-block></autolambda><list><l>denominator</l></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="GCD (or) %&apos;a&apos; $∨-1.2-255-255-0 %&apos;b&apos;" type="reporter" category="operators"><comment x="0" y="0" w="230.66666666666666" collapsed="false">Reports the greatest common divisor of its inputs.&#xD;If the inputs are values in {0,1} then this is equivalent to the logical OR of the values, with 0=False, 1=True.  Hence the APL symbol ∨.&#xD;Also accepts Snap! Booleans as inputs.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="simple gcd %n %n"><l></l><l></l></custom-block></autolambda><list></list></block></custom-block><list><custom-block s="de-boolean %s"><block var="a"/></custom-block><custom-block s="de-boolean %s"><block var="b"/></custom-block></list></block></block></script></block-definition><block-definition s="simple gcd %&apos;a&apos; %&apos;b&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="b"/><l>0</l></list></block><script><block s="doReport"><block var="a"/></block></script><list></list></block><block s="doReport"><custom-block s="simple gcd %n %n"><block var="b"/><block s="reportModulus"><block var="a"/><block var="b"/></block></custom-block></block></script></block-definition><block-definition s="scalar -&gt; hyper %&apos;func&apos;" type="reporter" category="control" helper="true"><comment x="0" y="0" w="218" collapsed="false">Takes a dyadic scalar function as input, and&#xD;hyperizes it, so that it can take lists as inputs.&#xD;&#xD;Don&apos;t use on slow functions (this has compiled map calls).  Meant for use on primitives.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input></inputs><script><block s="doDeclareVariables"><list><l>hyper func</l><l>scalarized</l></list></block><block s="doSetVar"><l>hyper func</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doIfElse"><custom-block s="scalar? %s"><block var="a"/></custom-block><script><block s="doIfElse"><custom-block s="scalar? %s"><block var="b"/></custom-block><script><block s="doReport"><block s="evaluate"><block var="func"/><list><custom-block s="scalar-value helper %s"><block var="a"/></custom-block><custom-block s="scalar-value helper %s"><block var="b"/></custom-block></list></block></block></script><script><block s="doSetVar"><l>scalarized</l><custom-block s="scalar-value helper %s"><block var="a"/></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><l></l><block s="reportAtomicFindFirst"><block s="reifyPredicate"><autolambda><block s="reportIsA"><l></l><l><option>list</option></l></block></autolambda><list></list></block><block var="b"/></block></list></block><script><block s="doReport"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="func"/><list><block var="scalarized"/><l></l></list></block></autolambda><list></list></block><block var="b"/></block></block></script><list></list></block><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="hyper func"/><list><block var="scalarized"/><l></l></list></block></autolambda><list></list></block><block var="b"/></block></block></script></block></script><script><block s="doIfElse"><custom-block s="scalar? %s"><block var="b"/></custom-block><script><block s="doSetVar"><l>scalarized</l><custom-block s="scalar-value helper %s"><block var="b"/></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><l></l><block s="reportAtomicFindFirst"><block s="reifyPredicate"><autolambda><block s="reportIsA"><l></l><l><option>list</option></l></block></autolambda><list></list></block><block var="a"/></block></list></block><script><block s="doReport"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="func"/><list><l></l><block var="scalarized"/></list></block></autolambda><list></list></block><block var="a"/></block></block></script><list></list></block><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="hyper func"/><list><l></l><block var="scalarized"/></list></block></autolambda><list></list></block><block var="a"/></block></block></script><script><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><l></l><block s="reportAtomicFindFirst"><block s="reifyPredicate"><autolambda><block s="reportIsA"><l></l><l><option>list</option></l></block></autolambda><list></list></block><block var="a"/></block></list></block><block s="reportVariadicEquals"><list><l></l><block s="reportAtomicFindFirst"><block s="reifyPredicate"><autolambda><block s="reportIsA"><l></l><l><option>list</option></l></block></autolambda><list></list></block><block var="b"/></block></list></block></list></block><script><block s="doReport"><custom-block s="multimap %repRing over %mult%l"><block var="func"/><list><block var="a"/><block var="b"/></list></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="multimap %repRing over %mult%l"><block var="hyper func"/><list><block var="a"/><block var="b"/></list></custom-block></block></script></block></script></block></script></block></script><list><l>a</l><l>b</l></list></block></block><block s="doReport"><block var="hyper func"/></block></script></block-definition><block-definition s="scalar? %&apos;x&apos;" type="predicate" category="other" helper="true"><comment x="0" y="0" w="199.33333333333334" collapsed="false">Reports True if the input is an APL scalar,&#xD;i.e., either an atomic (non-list) value, or&#xD;an array (list of lists) of any depth with only&#xD;one atomic item, e.g., (list (list (list (3)))).</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="x"/><l><option>list</option></l></block></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="doReport"><block s="reportVariadicEquals"><list><block s="reportAtomicCombine"><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="x"/></custom-block><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><l></l><l></l></list></block></autolambda><list></list></block></block><l>1</l></list></block></block></script></block-definition><block-definition s="shape of $⍴-1-255-255-0 %&apos;data&apos;" type="reporter" category="lists"><comment x="0" y="0" w="310" collapsed="false">Reports a flat list of the maximum size of the input array along&#xD;each dimension: number of rows, number of columns, etc.&#xD;&quot;Maximum&quot; because it works even if the array isn&apos;t uniformly shaped.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListAttribute"><l><option>dimensions</option></l><block var="data"/></block></block></script></block-definition><block-definition s="scalar-value helper %&apos;x&apos;" type="reporter" category="other" helper="true"><comment x="0" y="0" w="200.66666666666666" collapsed="false">The input must be a value for which SCALAR? reports true, i.e., either an atom or a list of any depth but only one scalar item of item of... etc.  This function returns the underlying scalar (number, etc.).</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="x"/><l><option>list</option></l></block></block><script><block s="doReport"><block var="x"/></block></script><list></list></block><block s="doReport"><custom-block s="scalar-value helper %s"><block s="reportListItem"><l>1</l><block var="x"/></block></custom-block></block></script></block-definition><block-definition s="multimap %&apos;function&apos; over %&apos;lists&apos;" type="reporter" category="lists"><comment x="0" y="0" w="267.3333333333333" collapsed="false">Takes as input a function of N inputs and N lists.&#xD;The function is called with item 1 of all the lists as its inputs, with item 2 of all the lists as its inputs, and so on.  (The lists should all be the same length.)</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%mult%l"></input></inputs><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="function"/><custom-block s="%s"><l></l></custom-block></block></autolambda><list></list></block><block s="reportListAttribute"><l><option>columns</option></l><block var="lists"/></block></block></block></script></block-definition><block-definition s="%&apos;x&apos;" type="reporter" category="lists"><comment x="0" y="0" w="105.33333333333333" collapsed="false">The identity function reports its input.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block var="x"/></block></script></block-definition><block-definition s="de-boolean %&apos;n&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="n"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="de-boolean %s"><l></l></custom-block></autolambda><list></list></block><block var="n"/></block></block></script><script><block s="doReport"><block s="reportIfElse"><custom-block s="zero? %n"><block var="n"/></custom-block><l>0</l><block s="reportIfElse"><block s="reportVariadicEquals"><list><block var="n"/><block s="reportBoolean"><l><bool>true</bool></l></block></list></block><l>1</l><block var="n"/></block></block></block></script></block></script></block-definition><block-definition s="zero? %&apos;n&apos;" type="predicate" category="other" helper="true"><comment x="0" y="0" w="202.66666666666666" collapsed="true">reports True iff the input is 0 or False.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportListContainsItem"><block s="reportNewList"><list><l>0</l><block s="reportBoolean"><l><bool>false</bool></l></block></list></block><block var="n"/></block></block></script></block-definition><block-definition s="$crosshairs flatten stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="118.24374999999998" collapsed="false">A variation of FLATTEN STREAM delivering a more balanced distribution of output items among substreams.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>stream*</l><l>substreams</l><l>insert counter</l></list></block><block s="doSetVar"><l>substreams</l><block s="reportNewList"><list></list></block></block><block s="doSetVar"><l>stream*</l><block var="stream"/></block><custom-block s="let %upvar $arrowLeft %s"><l>add substream if applicable</l><block s="reifyScript"><script><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><block var="insert counter"/><l>0</l></list></block><block s="reportNot"><custom-block s="is stream %l empty?"><block var="stream*"/></custom-block></block></list></block><script><block s="doSetVar"><l>substreams</l><block s="reportCONS"><custom-block s="head of stream %l"><block var="stream*"/></custom-block><block var="substreams"/></block></block><block s="doSetVar"><l>stream*</l><custom-block s="tail of stream %l"><block var="stream*"/></custom-block></block><block s="doSetVar"><l>insert counter</l><block s="reportListAttribute"><l><option>length</option></l><block var="substreams"/></block></block></script><list></list></block><block s="doChangeVar"><l>insert counter</l><l>-1</l></block></script><list></list></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>remove empty substreams</l><block s="reifyScript"><script><block s="doUntil"><block s="reportVariadicOr"><list><block s="reportListIsEmpty"><block var="substreams"/></block><block s="reportNot"><custom-block s="is stream %l empty?"><block s="reportListItem"><l>1</l><block var="substreams"/></block></custom-block></block></list></block><script><block s="doSetVar"><l>substreams</l><block s="reportCDR"><block var="substreams"/></block></block></script></block></script><list></list></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>flatten*</l><block s="reifyScript"><script><block s="doRun"><block var="add substream if applicable"/><list></list></block><block s="doRun"><block var="remove empty substreams"/><list></list></block><block s="doIf"><block s="reportListIsEmpty"><block var="substreams"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doSetVar"><l>substreams</l><custom-block s="round robin %l"><block var="substreams"/></custom-block></block><custom-block s="let %upvar $arrowLeft %s"><l>result</l><custom-block s="head of stream %l"><block s="reportListItem"><l>1</l><block var="substreams"/></block></custom-block></custom-block><block s="doReplaceInList"><l>1</l><block var="substreams"/><custom-block s="tail of stream %l"><block s="reportListItem"><l>1</l><block var="substreams"/></block></custom-block></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="result"/><block s="evaluate"><block var="flatten*"/><list></list></block></custom-block></block></script><list></list></block></custom-block><block s="doReport"><block s="evaluate"><block var="flatten*"/><list></list></block></block></script></block-definition><block-definition s="flatmap finite %&apos;function&apos; over stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="293.003125" collapsed="false">Create a stream that is the result of appending (rather tah interleaving) streams mapped over the input stream.&#xD;Will only be applicable if function (input 1) will create *finite* streams.&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="append substreams of %l"><custom-block s="map %repRing over stream(s) %mult%l"><block var="function"/><list><block var="stream"/></list></custom-block></custom-block></block></script><scripts><script x="10" y="115.00000000000001"><custom-block s="$speechBubble %mlt"><l>non-descending integer pairs</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="flatmap finite %repRing over stream %l"><block s="reifyReporter"><autolambda><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportNewList"><list><block var="#1"/><block var="#2"/></list></block></autolambda><list><l>#1</l></list></block><list><custom-block s="stream with numbers from %n to %n step %n"><l>1</l><block var="#2"/><l>1</l></custom-block></list></custom-block></autolambda><list><l>#2</l></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="round robin %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input></inputs><script><block s="doReport"><custom-block s="%l followed by %s"><block s="reportCDR"><block var="data"/></block><block s="reportListItem"><l>1</l><block var="data"/></block></custom-block></block></script></block-definition><block-definition s="interleave streams %&apos;streams&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="293.70580357142853" collapsed="false">Alternately report items from each stream.&#xD;A generalization of SICP function INTERLEAVE-DELAYED.&#xD;&#xD;For finite lists, the way to make one list combining the items from several input lists is to APPEND them.  But that doesn&apos;t work for possibly infinite streams; if the first stream is infinite, no items from the second or additional input streams would be included.  Instead, you have to INTERLEAVE the streams, take an item from the first one, an item from the second one, and so on.  This ensures that every item of every stream will turn up eventually in the result stream.&#xD;&#xD;This block makes no guarantees regarding the precise order in which items appear in the result stream.&#xD;&#xD;General info in streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%mult%anyUE" initial="2"></input></inputs><script><block s="doReport"><custom-block s="$gears HELPER interleave streams %l"><block var="streams"/></custom-block></block></script><scripts><script x="7.142857142857143" y="239.8571428571429"><custom-block s="$speechBubble %mlt"><l>Simple code for INTERLEAVE STREAMS (a ⋮) (b λ)</l></custom-block><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><block s="evaluate"><block var="b"/><list></list></block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="interleave streams %mult%anyUE"><list><block s="evaluate"><block var="b"/><list></list></block><custom-block s="tail of stream %l"><block var="a"/></custom-block></list></custom-block></custom-block></block></script><script x="7.142857142857143" y="393.7023809523809"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="interleave streams %mult%anyUE"><list><custom-block s="stream %mult%s"><list><l>1</l><l>2</l><l>3</l></list></custom-block><custom-block s="stream with numbers from %n"><l>11</l></custom-block></list></custom-block></custom-block></block></script><script x="7.142857142857143" y="486.01190476190453"><custom-block s="$speechBubble %mlt"><l>An example with several input streams</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="interleave streams %mult%anyUE"><list><custom-block s="the empty stream"></custom-block><custom-block s="stream %mult%s"><list><l>1</l><l>2</l><l>3</l></list></custom-block><custom-block s="stream %mult%s"><list><l>11</l></list></custom-block><custom-block s="stream with numbers from %n"><l>21</l></custom-block></list></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="append substreams of %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doReport"><custom-block s="append streams %mult%anyUE"><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="append substreams of %l"><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></list></custom-block></block></script></block-definition><block-definition s="merge streams %&apos;streams&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="160.80000000000024" collapsed="false">Merge 2 streams, in ascending order (as established by “_ &lt; _”).&#xD;&#xD;For the result stream to be in ascending (or non-descending) order, both of the input streams must be.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAMS.</comment><header></header><code></code><translations></translations><inputs><input type="%mult%l" initial="2"></input></inputs><script><block s="doSetVar"><l>streams</l><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportNot"><custom-block s="is stream %l empty?"><l/></custom-block></block></autolambda><list></list></block><block var="streams"/></block></block><block s="doIf"><block s="reportListIsEmpty"><block var="streams"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list><block s="reportListIsEmpty"><block s="reportCDR"><block var="streams"/></block></block><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="streams"/></block></block></script></list></block><custom-block s="let %upvar $arrowLeft %s"><l>keys</l><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="head of stream %l"><l/></custom-block></autolambda><list></list></block><block var="streams"/></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>kv-pairs</l><custom-block s="$flash sort %l ordering with %predRing"><block s="reportListAttribute"><l><option>columns</option></l><block s="reportNewList"><list><block var="keys"/><block var="streams"/></list></block></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><block s="reportListItem"><l>1</l><l/></block><block s="reportListItem"><l>1</l><l/></block></list></block></autolambda><list></list></block></custom-block></custom-block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block><custom-block s="merge streams %mult%l"><block s="reportCONS"><custom-block s="tail of stream %l"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>2</l><l/></block></autolambda><list></list></block><block s="reportCDR"><block var="kv-pairs"/></block></block></block></custom-block></custom-block></block></script><scripts><script x="20" y="578.8888888888887"><custom-block s="$speechBubble %mlt"><l>Simple code for MERGE STREAMS (a) (b)</l></custom-block><block s="doIf"><block s="reportVariadicOr"><list><custom-block s="is stream %l empty?"><block var="a"/></custom-block><custom-block s="is stream %l empty?"><block var="b"/></custom-block></list></block><script><block s="doReport"><custom-block s="append streams %mult%anyUE"><list><block var="a"/><block var="b"/></list></custom-block></block></script><list></list></block><block s="doIf"><block s="reportVariadicLessThan"><list><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="head of stream %l"><block var="b"/></custom-block></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="merge streams %mult%l"><list><block var="b"/><custom-block s="tail of stream %l"><block var="a"/></custom-block></list></custom-block></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="b"/></custom-block><custom-block s="merge streams %mult%l"><list><block var="a"/><custom-block s="tail of stream %l"><block var="b"/></custom-block></list></custom-block></custom-block></block></script><script x="20" y="833.2777777777782"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="merge streams %mult%l"><list><custom-block s="stream with numbers from %n"><l>5</l></custom-block><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l></l></list></block></autolambda><list></list></block><list><custom-block s="stream with numbers from %n"><l>1</l></custom-block></list></custom-block></list></custom-block></custom-block></block></script><script x="20" y="974.7222222222226"><custom-block s="$speechBubble %mlt"><l>Advanced version</l></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>original case sensitivity</l><block s="reportGlobalFlag"><l><option>case sensitivity</option></l></block></custom-block><block s="doSetGlobalFlag"><l><option>case sensitivity</option></l><l><bool>true</bool></l></block><custom-block s="let %upvar $arrowLeft %s"><l>result</l><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="merge streams %mult%l %br ordered by %repRing uniques? %b by %predRing"><list><custom-block s="stream %mult%s"><list><l>a</l><l>a</l><l>A</l></list></custom-block><custom-block s="stream %mult%s"><list><l>1</l><l>B</l><l>C</l><l>c</l></list></custom-block><custom-block s="stream %mult%s"><list><l>1</l><l>2</l><l>3</l></list></custom-block></list><block s="reifyReporter"><autolambda><block s="reportTextAttribute"><l><option>lower case</option></l><l></l></block></autolambda><list></list></block><l><bool>true</bool></l><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><l></l><l></l></list></block></autolambda><list></list></block></custom-block></custom-block></custom-block><block s="doSetGlobalFlag"><l><option>case sensitivity</option></l><block var="original case sensitivity"/></block><block s="doReport"><block var="result"/></block></script></scripts></block-definition><block-definition s="$gears flatten stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="293.003125" collapsed="false">Interleave streams that are themselves elements of a stream, such that they become one stream.&#xD;Does not work on streams whose 1st level items are not (all) streams.&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="stream"/></block></script><list></list></block><block s="doReport"><custom-block s="interleave streams %mult%anyUE"><list><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="$gears flatten stream %l"><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></list></custom-block></block></script></block-definition><block-definition s="list %&apos;requested&apos; items of stream %&apos;stream&apos;" type="reporter" category="Streams" space="true"><comment x="0" y="0" w="471.3368303571429" collapsed="false">Reports a list containing a specified number of items from a stream.&#xD;&#xD;Replaces SHOW STREAM from version 1 of this library.&#xD;&#xD;The inputs are an integer and a stream. With a positive integer, LIST ... STREAM reports a regular finite list of length less than (for shorter finite streams) or equal to the integer. It&apos;s useful because an infinite stream can&apos;t be displayed in a finite amount of time.&#xD;&#xD;Alternatively, ”all” (or “Infinity”) may be used as first input, for the showing to continue until the end of the stream will have been reached. Better not try this with infinite streams: the process will never terminate.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%n" initial="1">10<options>all=Infinity</options></input><input type="%l" initial="1"></input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>items</l><block s="reportNewList"><list></list></block></custom-block><block s="doUntil"><block s="reportVariadicOr"><list><block s="reportVariadicLessThan"><list><block var="requested"/><l>1.5</l></list></block><custom-block s="is stream %l empty?"><block var="stream"/></custom-block></list></block><script><block s="doAddToList"><custom-block s="head of stream %l"><block var="stream"/></custom-block><block var="items"/></block><block s="doChangeVar"><l>requested</l><l>-1</l></block><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block></script></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doReport"><block var="items"/></block></script><list></list></block><block s="doReport"><custom-block s="%l followed by %s"><block var="items"/><custom-block s="head of stream %l"><block var="stream"/></custom-block></custom-block></block></script><scripts><script x="20" y="353"><custom-block s="comment %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></block></script><script x="20" y="421"><custom-block s="comment %mlt"><l>Demo: the number of items requested is exactly the length of the stream</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream %mult%s"><block s="reportNumbers"><l>1</l><l>10</l></block></custom-block></custom-block></block></script><script x="20" y="503.83333333333286"><custom-block s="comment %mlt"><l>Demo: the length of a *finite* stream is less than &#xD;the number of items requested.</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="stream %mult%s"><block s="reportNumbers"><l>1</l><l>5</l></block></custom-block></custom-block></block></script><script x="20" y="598.6666666666667"><custom-block s="comment %mlt"><l>Demo: the length of an *infinite* stream is less than &#xD;the number of items requested. The process will not terminate.</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><l></l><l>6</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script><script x="20" y="713.4999999999998"><custom-block s="comment %mlt"><l>Advanced version, enabling continuation.</l></custom-block><custom-block s="ignore %s"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>continuation</l><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block><custom-block s="ignore %s"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>continuation*</l><block s="evaluate"><block var="continuation"/><list></list></block></custom-block></custom-block><block s="doReport"><custom-block s="list %n items with %upvar of stream %l"><l>5</l><l>continuation</l><block s="evaluate"><block var="continuation*"/><list></list></block></custom-block></block></script></scripts></block-definition><block-definition s="merge streams %&apos;streams&apos; $nl ordered by %&apos;key function&apos; uniques? %&apos;uniques&apos; by %&apos;distinguisher&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="406.8000000000002" collapsed="false">Merge any nunber of streams, ordered by key (ascending)&#xD;&#xD;INPUT&#xD;1. streams to be merged. For the algorithm to work, each of the streams must be pre-ordered by the same key function.&#xD;2. a reporter (“key function”) assigning a key to be sorted by, to each input stream item&#xD;3. switch indicating whether output items should be unique, as compared to previous items.&#xD;4. ”distinguisher”, a two-iitem predicate indicating whether one item is considered unique as compared to another item (default: “_ = _”).&#xD;RESULT&#xD;A stream of items from the input streams, ordered by the same key function, and possibly filtered for uniqueness.&#xD;REMARK &#xD;Keys are sorted in ascending order as established by “_ &lt; _”.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAMS.</comment><header></header><code></code><translations></translations><inputs><input type="%mult%l" initial="2"></input><input type="%repRing" initial="1"></input><input type="%b" initial="1">true</input><input type="%predRing" initial="1"></input></inputs><script><block s="doDeclareVariables"><list><l>head</l><l>key</l><l>pre-key</l><l>local history</l></list></block><block s="doUntil"><block s="reportVariadicOr"><list><block s="reportListIsEmpty"><block var="streams"/></block><block s="reportNot"><custom-block s="is stream %l empty?"><block s="reportListItem"><l>1</l><block var="streams"/></block></custom-block></block></list></block><script><block s="doSetVar"><l>streams</l><block s="reportCDR"><block var="streams"/></block></block></script></block><block s="doIf"><block s="reportListIsEmpty"><block var="streams"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list><block s="reportVariadicAnd"><list><block s="reportListIsEmpty"><block s="reportCDR"><block var="streams"/></block></block><block s="reportNot"><block var="uniques"/></block></list></block><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="streams"/></block></block></script></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="distinguisher"/><l></l></list></block><script><block s="doSetVar"><l>distinguisher</l><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><l></l><l></l></list></block></autolambda><list></list></block></block></script><list></list></block><custom-block s="let %upvar $arrowLeft %s"><l>keys</l><block s="reportMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><l/></custom-block></list></block></autolambda><list></list></block><block var="streams"/></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>kv-pairs</l><custom-block s="$flash sort %l ordering with %predRing"><block s="reportListAttribute"><l><option>columns</option></l><block s="reportNewList"><list><block var="keys"/><block var="streams"/></list></block></block><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><block s="reportListItem"><l>1</l><l/></block><block s="reportListItem"><l>1</l><l/></block></list></block></autolambda><list></list></block></custom-block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>merge*</l><block s="reifyScript"><script><block s="doSetVar"><l>pre-key</l><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></block><block s="doIf"><custom-block s="is stream %l empty?"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block><script><block s="doSetVar"><l>kv-pairs</l><block s="reportCDR"><block var="kv-pairs"/></block></block><block s="doIf"><block s="reportListIsEmpty"><block var="kv-pairs"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list><block s="reportVariadicAnd"><list><block s="reportListIsEmpty"><block s="reportCDR"><block var="kv-pairs"/></block></block><block s="reportNot"><block var="uniques"/></block></list></block><script><block s="doReport"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></block></script></list></block></script><list></list></block><block s="doReplaceInList"><l>1</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block></list></block></block><block s="doSetVar"><l>kv-pairs</l><custom-block s="$flash sort %l ordering with %predRing"><block var="kv-pairs"/><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><block s="reportListItem"><l>1</l><l/></block><block s="reportListItem"><l>1</l><l/></block></list></block></autolambda><list></list></block></custom-block></block><block s="doSetVar"><l>head</l><custom-block s="head of stream %l"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block></block><block s="doSetVar"><l>key</l><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></block><block s="doReplaceInList"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block><custom-block s="tail of stream %l"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block></block><block s="doIf"><block s="reportVariadicAnd"><list><block var="uniques"/><block s="reportVariadicEquals"><list><block var="key"/><block var="pre-key"/></list></block></list></block><script><block s="doIf"><block s="reportVariadicEquals"><list><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="evaluate"><block var="distinguisher"/><list><block var="head"/><l></l></list></block></autolambda><list></list></block><block var="local history"/></block><l></l></list></block><script><block s="doAddToList"><block var="head"/><block var="local history"/></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="head"/><block s="evaluate"><block var="merge*"/><list></list></block></custom-block></block></script><list></list></block><block s="doReport"><block s="evaluate"><block var="merge*"/><list></list></block></block></script><list></list></block><block s="doSetVar"><l>local history</l><block s="reportNewList"><list><block var="head"/></list></block></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="head"/><block s="evaluate"><block var="merge*"/><list></list></block></custom-block></block></script><list></list></block></custom-block><block s="doSetVar"><l>head</l><custom-block s="head of stream %l"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block></block><block s="doSetVar"><l>local history</l><block s="reportNewList"><list><block var="head"/></list></block></block><block s="doReplaceInList"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block><custom-block s="tail of stream %l"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="kv-pairs"/></block></block></custom-block></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="head"/><block s="evaluate"><block var="merge*"/><list></list></block></custom-block></block></script><scripts><script x="7.142857142857143" y="1443.5000000000002"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>original case sensitivity</l><block s="reportGlobalFlag"><l><option>case sensitivity</option></l></block></custom-block><block s="doSetGlobalFlag"><l><option>case sensitivity</option></l><l><bool>true</bool></l></block><custom-block s="let %upvar $arrowLeft %s"><l>result</l><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="merge streams %mult%l %br ordered by %repRing uniques? %b by %predRing"><list><custom-block s="stream %mult%s"><list><l>a</l><l>a</l><l>A</l></list></custom-block><custom-block s="stream %mult%s"><list><l>1</l><l>B</l><l>C</l><l>c</l></list></custom-block><custom-block s="stream %mult%s"><list><l>1</l><l>2</l><l>3</l></list></custom-block></list><block s="reifyReporter"><autolambda><block s="reportTextAttribute"><l><option>lower case</option></l><l></l></block></autolambda><list></list></block><l><bool>true</bool></l><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><l></l><l></l></list></block></autolambda><list></list></block></custom-block></custom-block></custom-block><block s="doSetGlobalFlag"><l><option>case sensitivity</option></l><block var="original case sensitivity"/></block><block s="doReport"><block var="result"/></block></script><script x="7.142857142857143" y="1668.7142857142883"><custom-block s="head of stream %l"><l/></custom-block></script><script x="7.142857142857143" y="1694.1428571428594"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="merge streams %mult%l %br ordered by %repRing uniques? %b by %predRing"><list><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l>10</l></list></block></autolambda><list></list></block><l>#</l><list><l>1</l></list></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l>10</l></list></block></autolambda><list></list></block><l>#</l><list><l>3</l></list></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l>10</l></list></block></autolambda><list></list></block><l>#</l><list><l>2</l></list></custom-block></list><block s="reifyReporter"><script></script><list></list></block><l/><block s="reifyPredicate"><script></script><list></list></block></custom-block></custom-block></block></script><script x="7.142857142857143" y="1866.7380952381016"><custom-block s="$speechBubble %mlt"><l>Demo of a related (hidden) block, that will keep any items from the 1st stream&#xD;that also appear in the 2nd (AND relation)</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br AND stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script><script x="7.142857142857143" y="2015.071428571436"><custom-block s="$speechBubble %mlt"><l>Demo of a related (hidden) block, that will keep any items from either of 2 streams (OR relation).&#xD;Items apprearing in both streams will appear in the output only once.</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br OR stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script><script x="7.142857142857143" y="2165.5238095238187"><custom-block s="$speechBubble %mlt"><l>Demo of a related block, that will keep any iems appearing in either of 2 streams,&#xD;but not in both (eXclusive OR relation)</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br XOR stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script><script x="7.142857142857143" y="2313.8571428571536"><custom-block s="$speechBubble %mlt"><l>Demo of a related (hidden) block, keeping any items from the first stream&#xD;that do NOT appear in the second.</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br but NOT stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="keep items from stream %&apos;a&apos; $nl AND stream %&apos;b&apos; $nl ordered by key %&apos;key function&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%l" initial="1"></input><input type="%repRing" initial="1"></input></inputs><script><block s="doIf"><block s="reportVariadicOr"><list><custom-block s="is stream %l empty?"><block var="a"/></custom-block><custom-block s="is stream %l empty?"><block var="b"/></custom-block></list></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doUntil"><block s="reportVariadicEquals"><list><custom-block s="%upvar $arrowLeft %s"><l>key a</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="a"/></custom-block></list></block></custom-block><custom-block s="%upvar $arrowLeft %s"><l>key b</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="b"/></custom-block></list></block></custom-block></list></block><script><block s="doIfElse"><block s="reportVariadicLessThan"><list><block var="key a"/><block var="key b"/></list></block><script><block s="doSetVar"><l>a</l><custom-block s="tail of stream %l"><block var="a"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block></script><script><block s="doSetVar"><l>b</l><custom-block s="tail of stream %l"><block var="b"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block></script></block></script></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="keep items from stream %l %br AND stream %l %br ordered by key %repRing"><custom-block s="tail of stream %l"><block var="a"/></custom-block><custom-block s="tail of stream %l"><block var="b"/></custom-block><block var="key function"/></custom-block></custom-block></block></script><scripts><script x="10" y="557.0833333333333"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br AND stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="keep items from stream %&apos;a&apos; $nl OR stream %&apos;b&apos; $nl ordered by key %&apos;key function&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%l" initial="1"></input><input type="%repRing" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><block var="b"/></block></script><list><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><block var="a"/></block></script></list></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="%upvar $arrowLeft %s"><l>key a</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="a"/></custom-block></list></block></custom-block><custom-block s="%upvar $arrowLeft %s"><l>key b</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="b"/></custom-block></list></block></custom-block></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="keep items from stream %l %br OR stream %l %br ordered by key %repRing"><custom-block s="tail of stream %l"><block var="a"/></custom-block><custom-block s="tail of stream %l"><block var="b"/></custom-block><block var="key function"/></custom-block></custom-block></block></script><list></list></block><block s="doIf"><block s="reportVariadicLessThan"><list><block var="key a"/><block var="key b"/></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="keep items from stream %l %br OR stream %l %br ordered by key %repRing"><custom-block s="tail of stream %l"><block var="a"/></custom-block><block var="b"/><block var="key function"/></custom-block></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="b"/></custom-block><custom-block s="keep items from stream %l %br OR stream %l %br ordered by key %repRing"><block var="a"/><custom-block s="tail of stream %l"><block var="b"/></custom-block><block var="key function"/></custom-block></custom-block></block></script><scripts><script x="10" y="581.8333333333335"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br OR stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="item %&apos;index&apos; of stream %&apos;stream&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="300.8" collapsed="false">Report a specific item from a stream. (i.e. stream in, item out)&#xD;The inputs are a positive integer (item number), and the stream.&#xD;&#xD;The equivalent of SICP function STREAM-REF.&#xD;&#xD;Note that looking for something in a stream by index isn&apos;t a very &quot;streamly&quot; style of work.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM</comment><header></header><code></code><translations></translations><inputs><input type="%n">1</input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportVariadicLessThan"><list><block var="index"/><l>0.5</l></list></block><script><block s="doReport"><l></l></block></script><list></list></block><block s="doUntil"><block s="reportVariadicOr"><list><block s="reportVariadicLessThan"><list><block var="index"/><l>1.5</l></list></block><custom-block s="is stream %l empty?"><block var="stream"/></custom-block></list></block><script><block s="doChangeVar"><l>index</l><l>-1</l></block><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block></script></block><block s="doReport"><custom-block s="head of stream %l"><block var="stream"/></custom-block></block></script><scripts><script x="7.14285714285711" y="235.72619047619074"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="item %n of stream %l"><l>5</l><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><l></l><l></l></list></block></autolambda><list></list></block><list><custom-block s="stream with numbers from %n"><l>11</l></custom-block></list></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$flash sort %&apos;data&apos; ordering with %&apos;function&apos;" type="reporter" category="lists"><comment x="0" y="0" w="161.14285714285708" collapsed="false">Reports a sorted version of the list in its first input slot, using the comparison function in the second input slot.  For a list of numbers, using &lt; as the comparison function will sort from low to high; using &gt; will sort from high to low.</comment><header></header><code></code><translations>ca:ordena _ segons criteri _&#xD;</translations><inputs><input type="%l"></input><input type="%predRing"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>lst_sort(list, fn)</l><list><block var="data"/><block var="function"/></list></block></block></script><scripts><script x="12" y="147.55555555555554"><block s="doDeclareVariables"><list><l>even items</l><l>odd items</l><l>merge</l><l>split</l><l>copy of data</l><l>id</l></list></block><block s="doSetVar"><l>id</l><block s="reifyScript"><script><block s="doReport"><l></l></block></script><list></list></block></block><block s="doSetVar"><l>copy of data</l><block s="reportMap"><block var="id"/><block var="data"/></block></block><block s="doSetVar"><l>split</l><block s="reifyScript"><script><block s="doSetVar"><l>even items</l><block s="reportNewList"><list></list></block></block><block s="doSetVar"><l>odd items</l><block s="reportNewList"><list></list></block></block><block s="doUntil"><block s="reportListIsEmpty"><block var="copy of data"/></block><script><block s="doAddToList"><block s="reportListItem"><l>1</l><block var="copy of data"/></block><block var="odd items"/></block><block s="doDeleteFromList"><l>1</l><block var="copy of data"/></block><block s="doIf"><block s="reportNot"><block s="reportListIsEmpty"><block var="copy of data"/></block></block><script><block s="doAddToList"><block s="reportListItem"><l>1</l><block var="copy of data"/></block><block var="even items"/></block><block s="doDeleteFromList"><l>1</l><block var="copy of data"/></block></script><list></list></block></script></block></script><list></list></block></block><block s="doSetVar"><l>merge</l><block s="reifyScript"><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="#1"/><block s="reportNewList"><list></list></block></list></block><script><block s="doReport"><block var="#2"/></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="#2"/><block s="reportNewList"><list></list></block></list></block><script><block s="doReport"><block var="#1"/></block></script><list></list></block><block s="doIfElse"><block s="evaluate"><block var="function"/><list><block s="reportListItem"><l>1</l><block var="#1"/></block><block s="reportListItem"><l>1</l><block var="#2"/></block></list></block><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="#1"/></block><block s="evaluate"><block var="merge"/><list><block s="reportCDR"><block var="#1"/></block><block var="#2"/></list></block></block></block></script><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="#2"/></block><block s="evaluate"><block var="merge"/><list><block var="#1"/><block s="reportCDR"><block var="#2"/></block></list></block></block></block></script></block></script><list><l>#1</l><l>#2</l></list></block></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="data"/><block s="reportNewList"><list></list></block></list></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block s="reportCDR"><block var="data"/></block><block s="reportNewList"><list></list></block></list></block><script><block s="doReport"><block var="data"/></block></script><list></list></block><block s="doRun"><block var="split"/><list></list></block><block s="doReport"><block s="evaluate"><block var="merge"/><list><custom-block s="$flash sort %l ordering with %predRing"><block var="odd items"/><block var="function"/></custom-block><custom-block s="$flash sort %l ordering with %predRing"><block var="even items"/><block var="function"/></custom-block></list></block></block></script></scripts></block-definition><block-definition s="keep items from stream %&apos;a&apos; $nl XOR stream %&apos;b&apos; $nl ordered by key %&apos;key function&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%l" initial="1"></input><input type="%repRing" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><block var="b"/></block></script><list><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><block var="a"/></block></script></list></block><block s="doUntil"><block s="reportVariadicNotEquals"><list><custom-block s="%upvar $arrowLeft %s"><l>key a</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="a"/></custom-block></list></block></custom-block><custom-block s="%upvar $arrowLeft %s"><l>key b</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="b"/></custom-block></list></block></custom-block></list></block><script><block s="doSetVar"><l>a</l><custom-block s="tail of stream %l"><block var="a"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><block var="b"/></block></script><list></list></block><block s="doSetVar"><l>b</l><custom-block s="tail of stream %l"><block var="b"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><block var="a"/></block></script><list></list></block></script></block><block s="doIf"><block s="reportVariadicLessThan"><list><block var="key a"/><block var="key b"/></list></block><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="keep items from stream %l %br XOR stream %l %br ordered by key %repRing"><custom-block s="tail of stream %l"><block var="a"/></custom-block><block var="b"/><block var="key function"/></custom-block></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="b"/></custom-block><custom-block s="keep items from stream %l %br XOR stream %l %br ordered by key %repRing"><block var="a"/><custom-block s="tail of stream %l"><block var="b"/></custom-block><block var="key function"/></custom-block></custom-block></block></script><scripts><script x="10" y="667.2500000000002"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br XOR stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="keep items from stream %&apos;a&apos; $nl but NOT stream %&apos;b&apos; $nl ordered by key %&apos;key function&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%l" initial="1"></input><input type="%repRing" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><block var="a"/></block></script></list></block><block s="doUntil"><block s="reportVariadicLessThan"><list><custom-block s="%upvar $arrowLeft %s"><l>key a</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="a"/></custom-block></list></block></custom-block><custom-block s="%upvar $arrowLeft %s"><l>key b</l><block s="evaluate"><block var="key function"/><list><custom-block s="head of stream %l"><block var="b"/></custom-block></list></block></custom-block></list></block><script><block s="doIfElse"><block s="reportVariadicEquals"><list><block var="key a"/><block var="key b"/></list></block><script><block s="doSetVar"><l>a</l><custom-block s="tail of stream %l"><block var="a"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><block s="doSetVar"><l>b</l><custom-block s="tail of stream %l"><block var="b"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><block var="a"/></block></script><list></list></block></script><script><block s="doSetVar"><l>b</l><custom-block s="tail of stream %l"><block var="b"/></custom-block></block><block s="doIf"><custom-block s="is stream %l empty?"><block var="b"/></custom-block><script><block s="doReport"><block var="a"/></block></script><list></list></block></script></block></script></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="keep items from stream %l %br but NOT stream %l %br ordered by key %repRing"><custom-block s="tail of stream %l"><block var="a"/></custom-block><block var="b"/><block var="key function"/></custom-block></custom-block></block></script><scripts><script x="7.142857142857143" y="670.2499999999997"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br but NOT stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="log stream %&apos;stream&apos; $nl to list %&apos;report&apos; labeled %&apos;label&apos; indexed? %&apos;indexed&apos;" type="reporter" category="Streams" space="true"><comment x="0" y="0" w="364.4000000000001" collapsed="false">Eavesdrop on a stream in action.&#xD;&#xD;For debugging purposes only! The log will consume a lot of memory.&#xD;&#xD;INPUTS:&#xD;1. the stream to be inspected&#xD;2. the list to be used as log (put it in a variable watcher to see changes happen)&#xD;3. a label for these log entries (optional: not used if this slot is left empty)&#xD;4. whether each entry into the log will be indexed (default: FALSE)&#xD;&#xD;Reports the input stream, so that it can be inserted in a composition of functions.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input><input type="%txt"></input><input type="%b">false</input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>index</l><l>0</l></custom-block><block s="doIf"><custom-block s="is %s empty?"><block var="label"/></custom-block><script><block s="doIf"><block var="indexed"/><script><block s="doReport"><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><script><block s="doChangeVar"><l>index</l><l>1</l></block><block s="doAddToList"><block s="reportNewList"><list><block var="index"/><l></l></list></block><block var="report"/></block><block s="doReport"><l></l></block></script><list></list></block><list><block var="stream"/></list></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><script><block s="doAddToList"><l></l><block var="report"/></block><block s="doReport"><l></l></block></script><list></list></block><list><block var="stream"/></list></custom-block></block></script><list></list></block><block s="doIf"><block var="indexed"/><script><block s="doReport"><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><script><block s="doChangeVar"><l>index</l><l>1</l></block><block s="doAddToList"><block s="reportNewList"><list><block var="label"/><block var="index"/><l></l></list></block><block var="report"/></block><block s="doReport"><l></l></block></script><list></list></block><list><block var="stream"/></list></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><script><block s="doAddToList"><block s="reportNewList"><list><block var="label"/><l></l></list></block><block var="report"/></block><block s="doReport"><l></l></block></script><list></list></block><list><block var="stream"/></list></custom-block></block></script><scripts><script x="10" y="573.9166666666665"><custom-block s="$speechBubble %mlt"><l>Demo: streams before and after KEEP</l></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>log</l><block s="reportNewList"><list></list></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>selection</l><custom-block s="list %n items of stream %l"><l>5</l><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><block s="reportModulus"><l></l><l>2</l></block><l>0</l></list></block></autolambda><list></list></block><custom-block s="log stream %l %br to list %l labeled %txt indexed? %b"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><block var="log"/><l></l><l><bool>false</bool></l></custom-block></custom-block></custom-block></custom-block><block s="doReport"><block s="reportNewList"><list><block s="reportCONS"><l>BEFORE:</l><block var="log"/></block><block s="reportCONS"><l>AFTER</l><block var="selection"/></block></list></block></block></script><script x="10" y="762.4166666666665"><custom-block s="$speechBubble %mlt"><l>Demo, with label and index</l></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>log</l><block s="reportNewList"><list></list></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>selection</l><custom-block s="list %n items of stream %l"><l>5</l><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><block s="reportModulus"><l></l><l>2</l></block><l>0</l></list></block></autolambda><list></list></block><custom-block s="log stream %l %br to list %l labeled %txt indexed? %b"><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><custom-block s="square %n"><l></l></custom-block></autolambda><list></list></block><list><custom-block s="stream with numbers from %n"><l>1</l></custom-block></list></custom-block><block var="log"/><l>squares</l><l><bool>true</bool></l></custom-block></custom-block></custom-block></custom-block><block s="doReport"><block s="reportCONS"><block s="reportNewList"><list><l>LABEL:</l><l>INDEX:</l><l>VALUE:</l></list></block><block var="log"/></block></block></script></scripts></block-definition><block-definition s="is %&apos;text&apos; empty?" type="predicate" category="operators"><header></header><code></code><translations>de:ist _ leer?&#xD;</translations><inputs><input type="%s">word</input></inputs><script><block s="doReport"><block s="reportVariadicEquals"><list><block var="text"/><l></l></list></block></block></script></block-definition><block-definition s="segment of stream %&apos;stream&apos; $nl starting with first item that %&apos;start condition&apos; $nl ending with next item that %&apos;end condition&apos; inclusive? %&apos;include&apos;" type="reporter" category="Streams"><comment x="0" y="0" w="415.8857142857144" collapsed="false">Reports a segment (a contiguous subset) of the input stream, based on given starting and ending conditions.  One use of this block is to select a finite subset of a potentially infinite stream, which might be necessary to avoid an infinite recursion.&#xD;&#xD;INPUTS:&#xD;1. input stream;&#xD;2. start condition;&#xD;3. end condition;&#xD;4. whether to include the first item satisfying the end condition (default = FALSE)&#xD;&#xD;SPECIFYING THE START AND END CONDITIONS&#xD;The two conditions are predicate functions of two inputs, namely, an item from the stream and that item&apos;s index (position in the stream).  In the start condition, the index is with respect to the input stream; in the end condition, though, the index is taken with respect to the /result/ stream.  If the start condition is empty, the resulting segment starts at the beginning of the input stream.  If the end condition is empty, the resulting segment will reach to the end of the input stream, or will be infinite if the input is infinite.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%predRing" initial="1"></input><input type="%predRing"></input><input type="%b" initial="1">false</input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="end condition"/><block s="reifyPredicate"><script></script><list></list></block></list></block><script><block s="doSetVar"><l>end condition</l><block s="reifyPredicate"><autolambda><block s="reportBoolean"><l><bool>false</bool></l></block></autolambda><list></list></block></block></script><list></list></block><block s="doReport"><custom-block s="$gears segment of stream %l once %predRing until %predRing inclusive? %b index %s"><block var="stream"/><block var="start condition"/><block var="end condition"/><block var="include"/><l>1</l></custom-block></block></script><scripts><script x="7.142857142857143" y="275.8571428571429"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>Infinity</l><custom-block s="segment of stream %l %br starting with first item that %predRing %br ending with next item that %predRing inclusive? %b"><custom-block s="stream with numbers from %n"><l>12</l></custom-block><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><l></l><l>15</l></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><block var="index"/><l>10</l></list></block></autolambda><list><l>value</l><l>index</l></list></block><l><bool>false</bool></l></custom-block></custom-block></block></script><script x="7.142857142857143" y="426.21428571428527"><custom-block s="$speechBubble %mlt"><l>Demo: (3, 4, 5)</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="segment of stream %l %br starting with first item that %predRing %br ending with next item that %predRing inclusive? %b"><custom-block s="stream with numbers from %n"><l>3</l></custom-block><block s="reifyPredicate"><script></script><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><l></l><l>5</l></list></block></autolambda><list></list></block><l><bool>false</bool></l></custom-block></custom-block></block></script><script x="7.142857142857143" y="547.3571428571421"><custom-block s="$speechBubble %mlt"><l>By contrast, a version of the above with KEEP&#xD;will not terminate (use red button to stop manually).</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThanOrEquals"><list><l></l><l>5</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>3</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="stream demo" type="command" category="Streams" space="true"><comment x="0" y="0" w="159.66666666666674" collapsed="false">Read the code while running it.&#xD;&#xD;General info on streams: read the help text of TAIL OF STREAM.</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>ones</l><l>ints</l><l>primes</l><l>rationals</l><l>hanoi</l></list></block><block s="bubble"><l>Press ▶ after each demonstration … and now, to continue.</l></block><block s="doPauseAll"></block><block s="doSetVar"><l>ones</l><custom-block s="%s in front of stream %anyUE"><l>1</l><block var="ones"/></custom-block></block><custom-block s="$gears show demo %txt %s %n"><l>An infinite stream of ones:</l><block var="ones"/><l>6</l></custom-block><block s="doSetVar"><l>ints</l><custom-block s="%s in front of stream %anyUE"><l>1</l><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l></l></list></block></autolambda><list></list></block><list><block var="ones"/><block var="ints"/></list></custom-block></custom-block></block><custom-block s="$gears show demo %txt %s %n"><l>A stream containing all the positive integers:</l><block var="ints"/><l>9</l></custom-block><block s="doSetVar"><l>primes</l><custom-block s="sieve %l"><custom-block s="stream with numbers from %n"><l>2</l></custom-block></custom-block></block><custom-block s="$gears show demo %txt %s %n"><l>A stream containing all the prime numbers:</l><block var="primes"/><l>12</l></custom-block><block s="doSetVar"><l>rationals</l><custom-block s="%s in front of stream %anyUE"><l>0</l><custom-block s="$crosshairs flatmap %repRing over stream %l"><block s="reifyReporter"><autolambda><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l>/</l><block var="denominator"/></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><custom-block s="GCD (or) %n $∨-1.2-255-255-0 %n"><l></l><block var="denominator"/></custom-block><l>1</l></list></block></autolambda><list></list></block><block s="reifyReporter"><script></script><list></list></block><custom-block s="stream with numbers from %n"><block var="denominator"/></custom-block></custom-block></autolambda><list><l>denominator</l></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block><custom-block s="$gears show demo %txt %s %n"><l>A stream containing all the positive rational numbers:</l><block var="rationals"/><l>15</l></custom-block><block s="doSetVar"><l>hanoi</l><custom-block s="interleave streams %mult%anyUE"><list><block var="ones"/><custom-block s="map %repRing over stream(s) %mult%l"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><l></l><l>1</l></list></block></autolambda><list></list></block><list><block var="hanoi"/></list></custom-block></list></custom-block></block><custom-block s="$gears show demo %txt %s %n"><l>A stream showing which disc to move next in an infinitely tall ”Towers of Hanoi” puzzle:</l><block var="hanoi"/><l>15</l></custom-block><block s="doSayFor"><l>Demo finished.</l><l>2</l></block></script></block-definition><block-definition s="sieve %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="300" collapsed="false">Call this block with STREAM WITH NUMBERS FROM 2&#xD;as its input to get the infinite stream of all the prime numbers.&#xD;&#xD;It&apos;s called SIEVE because the algorithm it uses is the Sieve of&#xD;Eratosthenes: https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAM.</comment><header></header><code></code><translations>pt:a crivagem do canal _&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="stream"/></custom-block><custom-block s="sieve %l"><custom-block s="keep items %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><block s="reportModulus"><l></l><custom-block s="head of stream %l"><block var="stream"/></custom-block></block><l>0</l></list></block></autolambda><list></list></block><custom-block s="tail of stream %l"><block var="stream"/></custom-block></custom-block></custom-block></custom-block></block></script><scripts><script x="10" y="171.28571428571436"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="sieve %l"><custom-block s="stream with numbers from %n"><l>2</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$gears show demo %&apos;description&apos; %&apos;demo&apos; %&apos;howmany&apos;" type="command" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%s"></input><input type="%n"></input></inputs><script><block s="doSayFor"><block var="description"/><l>2</l></block><block s="doSayFor"><l></l><l>0.5</l></block><block s="bubble"><custom-block s="show stream %l %n"><block var="demo"/><block var="howmany"/></custom-block></block><block s="doPauseAll"></block><block s="bubble"><l></l></block></script></block-definition><block-definition s="show stream %&apos;stream&apos; %&apos;requested&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="181.33333333333334" collapsed="false">As of v2 of the Streams library, this block is obsolete (kept as a hidden block for upward compatibility with v1).</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%n">10</input></inputs><script><block s="doReport"><custom-block s="list %n items of stream %l"><block var="requested"/><block var="stream"/></custom-block></block></script></block-definition><block-definition s="MORE stream blocks …" type="reporter" category="Streams"><comment x="0" y="0" w="62" collapsed="true">Edit me.</comment><header></header><code></code><translations></translations><inputs></inputs><script><custom-block s="$speechBubble %mlt %cs"><l>for upward compatibility with library v1!</l><script><custom-block s="· %anyUE"><custom-block s="map %repRing over stream %mult%l"><block s="reifyReporter"><script></script><list></list></block><list><l/></list></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="keep items such that %predRing from stream %l"><block s="reifyPredicate"><script></script><list></list></block><l/></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="show stream %l %n"><l/><l>10</l></custom-block></custom-block></script></custom-block><custom-block s="$speechBubble %mlt %cs"><l>create streams</l><script><custom-block s="· %anyUE"><custom-block s="stream with numbers from %n to %n step %n"><l>1</l><l>Infinity</l><l>1</l></custom-block></custom-block></script></custom-block><custom-block s="$speechBubble %mlt %cs"><l>higher order functions and UNIQUES</l><script><custom-block s="· %anyUE"><custom-block s="map %repRing over keep %predRing from map %repRing over stream %l"><block s="reifyReporter"><script></script><list></list></block><block s="reifyPredicate"><script></script><list></list></block><block s="reifyReporter"><script></script><list></list></block><l/></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="$crosshairs flatmap %repRing over stream %l"><block s="reifyReporter"><script></script><list></list></block><l/></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="flatmap finite %repRing over stream %l"><block s="reifyReporter"><script></script><list></list></block><l/></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="$flash uniques by %predRing latest 1st? %b of stream %l"><block s="reifyPredicate"><script></script><list></list></block><l/><l/></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="$flash integrate %repRing with precursor %s over stream %l"><block s="reifyReporter"><script></script><list></list></block><l></l><l/></custom-block></custom-block></script></custom-block><custom-block s="$speechBubble %mlt %cs"><l>mix streams</l><script><custom-block s="· %anyUE"><custom-block s="merge streams %mult%l %br ordered by %repRing uniques? %b by %predRing"><list><l/><l/></list><block s="reifyReporter"><script></script><list></list></block><l/><block s="reifyPredicate"><script></script><list></list></block></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="keep items from stream %l %br %s stream %l %br ordered by key %repRing"><l/><l>AND</l><l/><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></script></custom-block><custom-block s="$speechBubble %mlt %cs"><l>selectors</l><script><custom-block s="· %anyUE"><custom-block s="list %n items with %upvar of stream %l"><l>10</l><l>downstream</l><l/></custom-block></custom-block><custom-block s="· %anyUE"><block s="reifyScript"><script><custom-block s="%upvar for each %upvar in stream %l %cs"><l>#</l><l>item</l><l/><script></script></custom-block></script><list></list></block></custom-block></script></custom-block><custom-block s="$speechBubble %mlt %cs"><l>demos</l><script><custom-block s="· %anyUE"><custom-block s="sorted stream from unsorted list %l"><l/></custom-block></custom-block><custom-block s="· %anyUE"><custom-block s="sieve %l"><l/></custom-block></custom-block></script></custom-block><block s="doReport"><l>Edit me!</l></block></script></block-definition><block-definition s="keep items such that %&apos;pred&apos; from stream %&apos;stream&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="239.42239583333335" collapsed="false">As of v2 of the Streams Library, this function as been superseded by KEEP ITEMS () FROM STREAM ().</comment><header></header><code></code><translations>pt:os itens tais que _ do canal _&#xD;</translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="keep items %predRing from stream %l"><block var="pred"/><block var="stream"/></custom-block></block></script><scripts><script x="10" y="95.66666666666663"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items such that %predRing from stream %l"><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><block s="reportModulus"><l></l><l>2</l></block><l>0</l></list></block></autolambda><list></list></block><custom-block s="stream with numbers from %n"><l>1</l></custom-block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$gears HELPER stream repeating %&apos;items&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations>pt:um canal com _&#xD;</translations><inputs><input type="%l">help</input></inputs><script><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block s="reportListItem"><l>1</l><block var="items"/></block><custom-block s="$gears HELPER stream repeating %l"><custom-block s="%l followed by %s"><block s="reportCDR"><block var="items"/></block><block s="reportListItem"><l>1</l><block var="items"/></block></custom-block></custom-block></custom-block></block></script></block-definition><block-definition s="%&apos;#&apos; for each %&apos;item&apos; in stream %&apos;stream&apos; %&apos;action&apos;" type="command" category="Streams" helper="true"><comment x="0" y="0" w="238" collapsed="false">The stream equivalant of FOR EACH (item) OF (list).&#xD;&#xD;CAUTION&#xD;If the embedded action uses a variable that is external to this block, the variable can not be changed inside the action.&#xD;&#xD;General info on streams: see the help text of TAIL OF STREAMS.</comment><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%upvar"></input><input type="%l"></input><input type="%cs"></input></inputs><script><custom-block s="let %upvar $arrowLeft %s"><l>action*</l><custom-block s="substitute vars %s"><block var="action"/></custom-block></custom-block><block s="doSetVar"><l>#</l><l>1</l></block><block s="doUntil"><custom-block s="is stream %l empty?"><block var="stream"/></custom-block><script><block s="doSetVar"><l>item</l><custom-block s="head of stream %l"><block var="stream"/></custom-block></block><block s="doRun"><block s="reportAttributeOf"><block var="action*"/><block s="reportEnvironment"><l><option>script</option></l></block></block><list></list></block><block s="doChangeVar"><l>#</l><l>1</l></block><block s="doSetVar"><l>stream</l><custom-block s="tail of stream %l"><block var="stream"/></custom-block></block></script></block></script><scripts><script x="10" y="262.1666666666666"><custom-block s="%upvar for each %upvar in stream %l %cs"><l>#</l><l>item</l><custom-block s="stream %mult%s"><block s="reportNumbers"><l>11</l><l>20</l></block></custom-block><script><block s="doSayFor"><block s="reportNewList"><list><block var="#"/><block var="item"/></list></block><l>0.5</l></block></script></custom-block></script></scripts></block-definition><block-definition s="sorted stream from unsorted list %&apos;data&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="285.4601562500002" collapsed="false">A stream of sorted items (in ascending order) from an unsorted list. So item 1 of the stream is the list’s smallest item. If you are only looking for a few of a list’s smallest items, but don’t know how many in advance, this approach makes sense.&#xD;&#xD;For practical purposes, [SORTED] OF is usually faster, though. This is because the latter block’s JavaScript code was very much optimized for runtime efficiency - it ain’t fair, really.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="data"/></block><script><block s="doReport"><custom-block s="the empty stream"></custom-block></block></script><list></list></block><custom-block s="let %upvar $arrowLeft %s"><l>lowest</l><block s="reportVariadicMin"><block var="data"/></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>low index</l><block s="reportListIndex"><block var="lowest"/><block var="data"/></block></custom-block><custom-block s="let %upvar $arrowLeft %s"><l>length</l><block s="reportListAttribute"><l><option>length</option></l><block var="data"/></block></custom-block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><block var="lowest"/><custom-block s="sorted stream from unsorted list %l"><block s="reportListItem"><block s="reportVariadicSum"><list><block s="reportModulus"><block s="reportNumbers"><block var="low index"/><block s="reportDifference"><block s="reportVariadicSum"><list><block var="low index"/><block var="length"/></list></block><l>2</l></block></block><block var="length"/></block><l>1</l></list></block><block var="data"/></block></custom-block></custom-block></block></script><scripts><script x="10" y="355.74999999999994"><custom-block s="$speechBubble %mlt"><l>Demo: only the top-3 of lowest numbers from a large list is calculated</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>3</l><custom-block s="sorted stream from unsorted list %l"><block s="reportListAttribute"><l><option>shuffled</option></l><block s="reportNumbers"><l>1</l><l>123456</l></block></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="$speechBubble %&apos;text&apos; %&apos;action&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%mlt">no comment!</input><input type="%cs" initial="1"></input></inputs><script><block s="doRun"><block var="action"/><list></list></block></script></block-definition><block-definition s="$gears HELPER interleave streams %&apos;delayed streams&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="2"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block s="reportCDR"><block var="delayed streams"/></block></block><script><block s="doReport"><block s="reportIfElse"><block s="reportListIsEmpty"><block var="delayed streams"/></block><custom-block s="the empty stream"></custom-block><block s="evaluate"><block s="reportListItem"><l>1</l><block var="delayed streams"/></block><list></list></block></block></block></script><list></list></block><block s="doIf"><custom-block s="is stream %l empty?"><custom-block s="%upvar $arrowLeft %s"><l>first</l><block s="evaluate"><block s="reportListItem"><l>1</l><block var="delayed streams"/></block><list></list></block></custom-block></custom-block><script><block s="doReport"><custom-block s="$gears HELPER interleave streams %l"><block s="reportCDR"><block var="delayed streams"/></block></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="first"/></custom-block><custom-block s="$gears HELPER interleave streams %l"><custom-block s="%l followed by %s"><block s="reportCDR"><block var="delayed streams"/></block><custom-block s="delay %anyUE by %n"><custom-block s="tail of stream %l"><block var="first"/></custom-block><l></l></custom-block></custom-block></custom-block></custom-block></block></script></block-definition><block-definition s="interleave streams %&apos;a&apos; %&apos;b&apos;" type="reporter" category="Streams" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%anyUE" initial="1"></input></inputs><script><block s="doIf"><custom-block s="is stream %l empty?"><block var="a"/></custom-block><script><block s="doReport"><block s="evaluate"><block var="b"/><list></list></block></block></script><list></list></block><block s="doReport"><custom-block s="%s in front of stream %anyUE"><custom-block s="head of stream %l"><block var="a"/></custom-block><custom-block s="interleave streams %l %anyUE"><block s="evaluate"><block var="b"/><list></list></block><custom-block s="tail of stream %l"><block var="a"/></custom-block></custom-block></custom-block></block></script></block-definition><block-definition s="keep items from stream %&apos;a&apos; $nl %&apos;logical operator&apos; stream %&apos;b&apos; $nl ordered by key %&apos;key function&apos;" type="reporter" category="Streams" helper="true"><comment x="0" y="0" w="227.85714285714286" collapsed="false">Merge two streams, keeping only items satisfying a logical condition with respect to the items of a second stream.&#xD;&#xD;INPUT&#xD;1. primary stream;&#xD;2. logical operator (AND, OR, XOR, NOT);&#xD;3. secondary stream;&#xD;4. key function, by which both streams are supposed to have been pre-sorted (ascending).&#xD;&#xD;WHAT IT DOES (with each logical operator)&#xD;AND: items from the primary stream that are also in the secondary stream will be kept (in case of multiple copies in either stream: the output stream will contain as many copies as the minimum number of copies of both input streams);&#xD;OR: items that are either in the primary or secondary stream, or both, will be kept. &#xD;In case of multiple copies of an item: like AND.&#xD;XOR: like OR, but items that are in both streams will be excluded.&#xD;NOT: items are kept that are in the primary stream and not in the secondary stream.</comment><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%s" readonly="true" initial="1">AND<options>AND&#xD;OR&#xD;XOR&#xD;but NOT</options></input><input type="%l" initial="1"></input><input type="%repRing" initial="1"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="logical operator"/><l>AND</l></list></block><script><block s="doReport"><custom-block s="keep items from stream %l %br AND stream %l %br ordered by key %repRing"><block var="a"/><block var="b"/><block var="key function"/></custom-block></block></script><list><block s="reportVariadicEquals"><list><block var="logical operator"/><l>OR</l></list></block><script><block s="doReport"><custom-block s="keep items from stream %l %br OR stream %l %br ordered by key %repRing"><block var="a"/><block var="b"/><block var="key function"/></custom-block></block></script><block s="reportVariadicEquals"><list><block var="logical operator"/><l>XOR</l></list></block><script><block s="doReport"><custom-block s="keep items from stream %l %br XOR stream %l %br ordered by key %repRing"><block var="a"/><block var="b"/><block var="key function"/></custom-block></block></script></list></block><block s="doReport"><custom-block s="keep items from stream %l %br but NOT stream %l %br ordered by key %repRing"><block var="a"/><block var="b"/><block var="key function"/></custom-block></block></script><scripts><script x="7.142857142857143" y="388.83333333333366"><custom-block s="$speechBubble %mlt"><l>Demo</l></custom-block><block s="doReport"><custom-block s="list %n items of stream %l"><l>10</l><custom-block s="keep items from stream %l %br %s stream %l %br ordered by key %repRing"><custom-block s="stream with numbers from %n"><l>1</l></custom-block><l>XOR</l><custom-block s="generate stream %repRing %upvar w/seeds: %mult%s"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="#"/><l>2.5</l></list></block></autolambda><list></list></block><l>#</l><list></list></custom-block><block s="reifyReporter"><script></script><list></list></block></custom-block></custom-block></block></script></scripts></block-definition><block-definition s="%&apos;value&apos; following %&apos;data&apos;" type="reporter" category="lists"><comment x="0" y="0" w="187.00000000000003" collapsed="false">The counterpart of IN FRONT OF: returns the first input attached at the back end of the list that is the second input</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportConcatenatedLists"><list><block var="data"/><block s="reportNewList"><list><block var="value"/></list></block></list></block></block></script></block-definition><block-definition s="square %&apos;number&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n" initial="1"></input></inputs><script><block s="doReport"><block s="reportVariadicProduct"><list><block var="number"/><block var="number"/></list></block></block></script></block-definition><block-definition s="reverse %&apos;list&apos;" type="reporter" category="lists"><comment x="0" y="0" w="90" collapsed="false">Reverses a list.</comment><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input></inputs><script><block s="doReport"><custom-block s="$gears reverse HELPER %l %s"><block var="list"/><block s="reportListItem"><l>1</l><block var="list"/></block></custom-block></block></script></block-definition><block-definition s="$gears reverse HELPER %&apos;list&apos; %&apos;start&apos;" type="reporter" category="lists" helper="true"><comment x="0" y="0" w="90" collapsed="false">The helper for reverse.</comment><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%s" initial="1"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block s="reportListItem"><l><option>last</option></l><block var="list"/></block><block var="start"/></list></block><block var="list"/><custom-block s="$gears reverse HELPER %l %s"><custom-block s="round robin %l"><block var="list"/></custom-block><block var="start"/></custom-block></block></block></script></block-definition><block-definition s="catch %&apos;tag&apos; %&apos;action&apos;" type="command" category="control"><header></header><code></code><translations>de:fange _ _&#xD;ca:agafa _ _&#xD;es:atrapar _ _&#xD;fr:attrape _ _&#xD;pt:captura _ _&#xD;pl:przechwyć _ _&#xD;</translations><inputs><input type="%upvar"></input><input type="%cs"></input></inputs><script><custom-block s="run %cmdRing with continuation"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doRun"><block var="action"/><list></list></block></script><list><l>cont</l></list></block></custom-block></script></block-definition><block-definition s="throw %&apos;cont&apos;" type="command" category="control"><header></header><code></code><translations>de:wirf _&#xD;ca:llança _&#xD;es:lanzar _&#xD;fr:lance _&#xD;pt:lança _&#xD;pl:wyrzuć _&#xD;</translations><inputs><input type="%s">catchtag</input></inputs><script><block s="doRun"><block var="cont"/><list></list></block></script></block-definition><block-definition s="catch %&apos;tag&apos; %&apos;value&apos;" type="reporter" category="control"><header></header><code></code><translations>de:fange _ _&#xD;ca:agafa _ _&#xD;es:atrapar _ _&#xD;fr:attrape _ _&#xD;pt:captura _ _&#xD;pl:przechwyć _ _&#xD;</translations><inputs><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><custom-block s="run %cmdRing with continuation"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doReport"><block s="evaluate"><block var="value"/><list></list></block></block></script><list><l>cont</l></list></block></custom-block></script></block-definition><block-definition s="throw %&apos;tag&apos; %&apos;value&apos;" type="command" category="control"><header></header><code></code><translations>de:wirf _ _&#xD;ca:llança _ _&#xD;es:lanzar _ _&#xD;fr:lance _ _&#xD;pt:lança _ _&#xD;pl:wyrzuć _ _&#xD;</translations><inputs><input type="%s">catchtag</input><input type="%s"></input></inputs><script><block s="doRun"><block var="tag"/><list><block var="value"/></list></block></script></block-definition><block-definition s="if %&apos;test&apos; do %&apos;action&apos; and pause all $pause-1-255-220-0" type="command" category="control"><comment x="0" y="0" w="263.3333333333333" collapsed="false">This is a breakpoint block, to be used in debugging.&#xD;The Boolean input specifies the condition under which&#xD;the program should pause.  (Use True for an unconditional breakpoint.)  The intent is that the script should have&#xD;SHOW VARIABLE blocks for the process&apos;s local variables.&#xD;After the pause, this block automatically hides all temporary variables.</comment><header></header><code></code><translations>de:falls _ dann _ und pause $pause-1-255-220-0&#xD;ca:si _ fes _ i atura-ho tot $pause-1-255-220-0&#xD;es:si _ haz _ y páralo todo $pause-1-255-220-0&#xD;fr:si _ faire _ et mettre tout en pause $pause-1-255-220-0&#xD;pt:se _ , então _ e faz pausa em tudo $pause-1-255-220-0&#xD;pl:jeżeli _ wykonaj _ i pauzuj wszystko $pause-1-255-220-0&#xD;</translations><inputs><input type="%boolUE"></input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>breakpoint</l></list></block><block s="doIf"><block s="evaluate"><block var="test"/><list></list></block><script><block s="doSetVar"><l>breakpoint</l><block var="test"/></block><block s="doShowVar"><l>breakpoint</l></block><block s="doRun"><block var="action"/><list></list></block><block s="doPauseAll"></block><block s="doHideVar"><l></l></block></script><list></list></block></script></block-definition><block-definition s="cascade %&apos;num&apos; times %&apos;function&apos; %&apos;init&apos; %&apos;#&apos;" type="reporter" category="control"><comment x="0" y="0" w="138" collapsed="false">Call f(f(f(...(f(x))))) n times where the three input slots are n, f, and x from left to right.  The # variable can be used inside f to represent how many times f has been called.</comment><header></header><code></code><translations>pt:o resultado de _ invocações em cascata de _ com argumento inicial _ _&#xD;ca:en cascada _ vegades _ _ _&#xD;pl:kaskada _ razy _ _ _&#xD;</translations><inputs><input type="%n"></input><input type="%repRing"></input><input type="%s"></input><input type="%upvar"></input></inputs><script><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doSetVar"><l>result</l><block var="init"/></block><block s="doSetVar"><l>#</l><l>0</l></block><block s="doRepeat"><block var="num"/><script><block s="doChangeVar"><l>#</l><l>1</l></block><block s="doSetVar"><l>result</l><block s="evaluate"><block var="function"/><list><block var="result"/></list></block></block></script></block><block s="doReport"><block var="result"/></block></script></block-definition><block-definition s="cascade until %&apos;pred&apos; %&apos;function&apos; %&apos;init&apos; %&apos;#&apos;" type="reporter" category="control"><comment x="0" y="0" w="210.47493489583334" collapsed="false">Call f(f(f(...(f(x))))) until condition is true, where the three input slots are condition, f, and x from left to right.  The # variable can be used inside f or condition to indicate how many times f has been called.</comment><header></header><code></code><translations>pt:o resultado da invocação em cascata até que _ de _ com argumento inicial _ _&#xD;ca:en cascada fins _ _ _ _&#xD;pl:kaskada aż _ _ _ _&#xD;</translations><inputs><input type="%predRing"></input><input type="%repRing"></input><input type="%s"></input><input type="%upvar"></input></inputs><script><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doSetVar"><l>result</l><block var="init"/></block><block s="doSetVar"><l>#</l><l>0</l></block><block s="doUntil"><block s="evaluate"><block var="pred"/><list><block var="result"/></list></block><script><block s="doChangeVar"><l>#</l><l>1</l></block><block s="doSetVar"><l>result</l><block s="evaluate"><block var="function"/><list><block var="result"/></list></block></block></script></block><block s="doReport"><block var="result"/></block></script></block-definition><block-definition s="compose %&apos;f&apos; %&apos;g&apos;" type="reporter" category="control"><comment x="0" y="0" w="151.33333333333334" collapsed="false">Returns the function x↦f(g(x)) where f and g are the two inputs.</comment><header></header><code></code><translations>pt:a composição de _ com _&#xD;ca:composa _ _&#xD;pl:skomponuj _ _&#xD;</translations><inputs><input type="%repRing"></input><input type="%repRing"></input></inputs><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="f"/><list><block s="evaluate"><block var="g"/><list><l></l></list></block></list></block></autolambda><list></list></block></block></script></block-definition><block-definition s="repeat %&apos;action&apos; until %&apos;pred&apos;" type="command" category="control"><comment x="0" y="0" w="202.66666666666666" collapsed="false">Like the built-in REPEAT UNTIL block, except that the ending condition is not tested until the script has been run the first time.  So the script is run at least once.</comment><header></header><code></code><translations>pt:repete _ até que _ $loop-0.7&#xD;ca:repeteix _ fins _&#xD;pl:powtarzaj _ aż _&#xD;</translations><inputs><input type="%cs"></input><input type="%boolUE"></input></inputs><script><block s="doRun"><block var="action"/><list></list></block><block s="doUntil"><block s="evaluate"><block var="pred"/><list></list></block><script><block s="doRun"><block var="action"/><list></list></block></script></block></script></block-definition><block-definition s="repeat %&apos;action&apos; while %&apos;pred&apos;" type="command" category="control"><comment x="0" y="0" w="287.3333333333333" collapsed="false">Run the script repeatedly, as long as the given condition is true.  Runs the script at least once before testing the condition.</comment><header></header><code></code><translations>pt:repete _ enquanto _ $loop-0.7&#xD;ca:repeteix _ mentre _&#xD;pl:powtarzaj _ gdy _&#xD;</translations><inputs><input type="%cs"></input><input type="%boolUE"></input></inputs><script><block s="doRun"><block var="action"/><list></list></block><block s="doUntil"><block s="reportNot"><block s="evaluate"><block var="pred"/><list></list></block></block><script><block s="doRun"><block var="action"/><list></list></block></script></block></script></block-definition><block-definition s="repeat while %&apos;pred&apos; %&apos;action&apos;" type="command" category="control"><comment x="0" y="0" w="264" collapsed="false">Runs the script repeatedly, as long as the condition is true. Tests the condition before the first time the script is run.  Like the built in REPEAT UNTIL except that in this block the condition must be true, not false.</comment><header></header><code></code><translations>pt:enquanto _ , repete _ $loop-0.7&#xD;pl:powtarzaj gdy _ _&#xD;</translations><inputs><input type="%boolUE"></input><input type="%cs"></input></inputs><script><block s="doUntil"><block s="reportNot"><block s="evaluate"><block var="pred"/><list></list></block></block><script><block s="doRun"><block var="action"/><list></list></block></script></block></script></block-definition><block-definition s="repeat %&apos;num&apos; %&apos;#&apos; %&apos;action&apos;" type="command" category="control"><comment x="0" y="0" w="171" collapsed="false">Runs the script the specified number of times, like the built-in REPEAT block, but this one provides the # variable that can be used inside the script.  Try&#xD;REPEAT (200)&#xD;                MOVE (#) STEPS&#xD;   RIGHT 92&#xD;with the pen down.</comment><header></header><code></code><translations>pt:repete _ vezes _ _ $loop-0.7&#xD;ca:repeteix _ _ _&#xD;pl:powtórz _ _ _&#xD;</translations><inputs><input type="%n"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doSetVar"><l>#</l><l>0</l></block><block s="doRepeat"><block var="num"/><script><block s="doChangeVar"><l>#</l><l>1</l></block><block s="doRun"><block var="action"/><list></list></block></script></block></script></block-definition><block-definition s="for %&apos;i&apos; = %&apos;start&apos; step %&apos;step&apos; to %&apos;end&apos; %&apos;action&apos;" type="command" category="control"><comment x="0" y="0" w="247.33333333333334" collapsed="false">The primitive FOR block uses an implicit step of ±1 depending on which of the starting and ending values is larger.  This version allows you to provide an explicit step value.  If the sign of the step input is incompatible with the ordering of the starting and ending values, the script will not be run at all.</comment><header></header><code></code><translations>pt:para _ de _ com passo _ a _ _ $loop-0.7&#xD;ca:per _ = _ incrementant _ fins _ _&#xD;pl:dla _ = _ co _ do _ _&#xD;</translations><inputs><input type="%upvar"></input><input type="%n">1</input><input type="%n">1</input><input type="%n">10</input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>test</l></list></block><block s="doSetVar"><l>i</l><block var="start"/></block><block s="doIfElse"><block s="reportVariadicLessThan"><list><block var="step"/><l>0</l></list></block><script><block s="doSetVar"><l>test</l><block s="reifyPredicate"><autolambda><block s="reportVariadicLessThan"><list><block var="i"/><block var="end"/></list></block></autolambda><list></list></block></block></script><script><block s="doSetVar"><l>test</l><block s="reifyPredicate"><autolambda><block s="reportVariadicGreaterThan"><list><block var="i"/><block var="end"/></list></block></autolambda><list></list></block></block></script></block><block s="doUntil"><block s="evaluate"><block var="test"/><list></list></block><script><block s="doRun"><block var="action"/><list></list></block><block s="doChangeVar"><l>i</l><block var="step"/></block></script></block></script></block-definition><block-definition s="let %&apos;a&apos; be %&apos;val&apos; in %&apos;loop&apos; %&apos;body&apos;" type="command" category="control"><comment x="0" y="0" w="238.66666666666666" collapsed="false">Provides LOOP as a function of one input that runs&#xD;the body of the LET with A set to the function input,&#xD;so the body can run itself recursively.&#xD;See COPY block in Variables for an example of use.</comment><header></header><code></code><translations>pt:tendo _ o valor inicial _ , executa _ definido como _&#xD;ca:fes que _ sigui _ al _ _&#xD;pl:ustaw _ na _ w _ _&#xD;</translations><inputs><input type="%upvar"></input><input type="%s"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doSetVar"><l>a</l><block var="val"/></block><block s="doSetVar"><l>loop</l><block s="reifyScript"><script><block s="doSetVar"><l>a</l><block var="new value"/></block><block s="doRun"><block var="body"/><list><block var="a"/></list></block></script><list><l>new value</l></list></block></block><block s="doRun"><block var="loop"/><list><block var="a"/></list></block></script></block-definition><block-definition s="run %&apos;action&apos; with continuation" type="command" category="control"><header></header><code></code><translations>de:führe _ mit Continuation aus&#xD;</translations><inputs><input type="%cmdRing" initial="1"></input></inputs><script><block s="doRun"><block var="action"/><list><block s="reportEnvironment"><l><option>continuation</option></l></block></list></block></script></block-definition><block-definition s="call %&apos;action&apos; with continuation" type="reporter" category="control"><header></header><code></code><translations>de:rufe _ mit Continuation auf&#xD;</translations><inputs><input type="%cmdRing" initial="1"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reifyReporter"><script><custom-block s="run %cmdRing with continuation"><block var="action"/></custom-block></script><list></list></block><list></list></block></block></script></block-definition><block-definition s="var %&apos;_name&apos;" type="reporter" category="variables"><comment x="0" y="0" w="178.00000000000003" collapsed="false">This block reports the value of the variable with the name given.&#xD;&#xD;It looks for that variable following the scope order &apos;script&apos; -&gt; &apos;sprite&apos; -&gt; &apos;global&apos; (the first match it finds).&#xD;&#xD;If that variable does not exist (in any scope) an error happens, stopping their script. You can check it before using the &quot;does var (name) exists?&quot; block. </comment><header></header><code></code><translations>pt:o valor de _&#xD;pl:zmienna _&#xD;</translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>var_get(name)</l><list><block var="_name"/></list></block></block></script></block-definition><block-definition s="create %&apos;_scope&apos; var %&apos;_names&apos;" type="command" category="variables"><comment x="0" y="0" w="146" collapsed="false">This block creates  new variables on the selected scope: global (for all sprites), sprite (for this sprite only) or script (only for that blocks stack) with the names given (in &apos;names&apos; list).&#xD;&#xD;If there is already a variable with that name in that scope, it does nothing: no errors and no overwrites.</comment><header></header><code></code><translations>pt:cria as variáveis _ _&#xD;ca:crea les _ variables _&#xD;es:crear las _ variables _&#xD;de:erstellen _ var _&#xD;pl:utwórz zmienną _ _&#xD;</translations><inputs><input type="%s" readonly="true">global<options>global&#xD;sprite&#xD;script</options></input><input type="%mult%txt"></input></inputs><script><block s="doWarp"><script><block s="doForEach"><l>_item</l><block var="_names"/><script><block s="doApplyExtension"><l>var_declare(scope, name)</l><list><block var="_scope"/><block var="_item"/></list></block></script></block></script></block></script></block-definition><block-definition s="delete var %&apos;_names&apos;" type="command" category="variables"><comment x="0" y="0" w="217" collapsed="false">This block deletes all the variables with the names given (inside input list).&#xD;&#xD;Each name will make only one variable deletion, and this will be the variable found following the scope order: &apos;script&apos; -&gt; &apos;sprite&apos; -&gt; &apos;global&apos;.&#xD;&#xD;If we have a &quot;testing&quot; sprite variable and also a &quot;testing&quot; global one, deleting &quot;testing&quot; will delete only the sprite one (Yes! we can also do &quot;delete var (testing, testing)&quot; to delete both.&#xD;&#xD;If one variable does not exists (in any scope) an error happens, stopping block action in that point. You can check it before with the &quot;does var (name) exists?&quot;block. </comment><header></header><code></code><translations>pt:remove as variáveis _&#xD;ca:esborra les variables _&#xD;es:borrar variables _&#xD;de:löschen var _&#xD;pl:usuń zmienną _&#xD;</translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doWarp"><script><block s="doForEach"><l>_item</l><block var="_names"/><script><block s="doApplyExtension"><l>err_ignore</l><list><custom-block s="var %s"><block var="_item"/></custom-block></list></block><block s="doApplyExtension"><l>var_delete(name)</l><list><block var="_item"/></list></block></script></block></script></block></script></block-definition><block-definition s="set var %&apos;_name&apos; to %&apos;_value&apos;" type="command" category="variables"><comment x="0" y="0" w="240.4931640625" collapsed="false">This block sets the given value (last input) to the variable named with the name givent (var input).&#xD;&#xD;It looks for that variable following the scope order &apos;script&apos; -&gt; &apos;sprite&apos; -&gt; &apos;global&apos; (the first match it finds).&#xD;&#xD;If that variable does not exist (in any scope) an error happens, stopping their script. You can check it before using the &quot;does var (name) exists?&quot; block. </comment><header></header><code></code><translations>ca:assigna a _ el valor _&#xD;es:asignar a _ el valor _&#xD;pt:altera _ para _&#xD;de:setze var _ auf _&#xD;pl:ustaw zmienną _ na _&#xD;</translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input><input type="%s"></input></inputs><script><block s="doApplyExtension"><l>var_set(name, val)</l><list><block var="_name"/><block var="_value"/></list></block></script></block-definition><block-definition s="does var %&apos;_name&apos; exist?" type="predicate" category="variables"><comment x="0" y="0" w="146" collapsed="false">This block reports &quot;true&quot; if there is a variable with this given name (input slot) in that context.&#xD;&#xD;It can be a global, sprite or script variable.&#xD;&#xD;Otherwise it reports &quot;false&quot;.</comment><header></header><code></code><translations>pt:a variável _ existe&#xD;ca:existeix la variable _ ?&#xD;es:existe la variable _ ?&#xD;de:existiert var _ ?&#xD;pl:zmienna _ istnieje?&#xD;</translations><inputs><input type="%s"></input></inputs><script><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block s="reifyScript"><script><block s="doApplyExtension"><l>err_ignore</l><list><block s="reportApplyExtension"><l>var_get(name)</l><list><block var="_name"/></list></block></list></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="reifyScript"><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><l></l></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block></script></block-definition><block-definition s="show var %&apos;_name&apos;" type="command" category="variables"><comment x="0" y="0" w="181" collapsed="false">This block turns on (show) the watcher view on stage (if it was not already activated) of the variable with the given name (slot input).&#xD;&#xD;It can only access to the closest variable scope (if there different variables with the same name in different scopes) following the order &apos;script&apos; -&gt; &apos;sprite&apos; -&gt; &apos;global&apos;.&#xD;&#xD;No errors if that variable does not exist.</comment><header></header><code></code><translations>ca:mostra la variable _&#xD;es:mostrar variable _&#xD;pt:mostra a variável _&#xD;de:zeige var _&#xD;pl:pokaż zmienną _&#xD;</translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doApplyExtension"><l>var_show(name)</l><list><block var="_name"/></list></block></script></block-definition><block-definition s="hide var %&apos;_name&apos;" type="command" category="variables"><comment x="0" y="0" w="181" collapsed="false">This block turns off (hide) the watcher view on stage (if it was not already activated) of the variable with the given name (slot input).&#xD;&#xD;It can only access to the closest variable scope (if there different variables with the same name in different scopes) following the order &apos;script&apos; -&gt; &apos;sprite&apos; -&gt; &apos;global&apos;.&#xD;&#xD;No errors if that variable does not exist.</comment><header></header><code></code><translations>ca:amaga la variable _&#xD;es:esconder variable _&#xD;pt:esconde a variável _&#xD;de:verstecke var _&#xD;pl:ukryj zmienną _&#xD;</translations><inputs><input type="%s"><options>§_getVarNamesDict</options></input></inputs><script><block s="doApplyExtension"><l>var_hide(name)</l><list><block var="_name"/></list></block></script></block-definition><block-definition s="define %&apos;var&apos; as %&apos;val&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%s" initial="1"></input><input type="%s" initial="1"></input></inputs><script><custom-block s="create %s var %mult%txt"><l>script</l><list><block var="var"/></list></custom-block><custom-block s="set var %s to %s"><block var="var"/><block var="val"/></custom-block></script></block-definition><block-definition s="wait %&apos;x&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%n" initial="1">1</input></inputs><script><block s="doWait"><block var="x"/></block></script></block-definition><block-definition s="reshape as %&apos;shape&apos; $⍴-1-255-255-0 items of %&apos;data&apos;" type="reporter" category="lists"><comment x="0" y="0" w="180" collapsed="false">The first input is a shape list as in&#xD;SHAPE OF.  The output is an array with those dimensions containing  the atomic items of the second input,&#xD;repeating values if more are needed.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportReshape"><block var="data"/><block var="shape"/></block></block></script></block-definition><block-definition s="max %&apos;a&apos; $⌈-1-255-255-0 %&apos;b&apos;" type="reporter" category="operators"><comment x="0" y="0" w="150.66666666666666" collapsed="false">Reports the greater of its two inputs. Works on strings too.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportVariadicMax"><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="flatten (ravel) $,-1-255-255-0 %&apos;data&apos;" type="reporter" category="lists"><comment x="0" y="0" w="216" collapsed="false">Reports a flat list of all the atomic elements &#xD;of sublists of the input list.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListAttribute"><l><option>flatten</option></l><block var="data"/></block></block></script></block-definition><block-definition s="rank of $⍴⍴-1-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="240" collapsed="true">Reports the number of dimensions of the input.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListAttribute"><l><option>rank</option></l><block var="array"/></block></block></script></block-definition><block-definition s="inner product helper with %&apos;plus&apos; . %&apos;times&apos; %&apos;a&apos; $nl transposed %&apos;tb&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%repRing"></input><input type="%l"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="a"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><list></list></block><block s="doIf"><block s="reportNot"><block s="reportIsA"><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="a"/></block></block><l><option>list</option></l></block></block><script><block s="doReport"><block s="reportCONS"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="generalized dotproduct %l %l with sum %repRing product %repRing"><block s="reportListItem"><l>1</l><block var="a"/></block><l/><block var="plus"/><block var="times"/></custom-block></autolambda><list></list></block><block var="tb"/></block><custom-block s="inner product helper with %repRing . %repRing %l %br transposed %l"><block var="plus"/><block var="times"/><block s="reportCDR"><block var="a"/></block><block var="tb"/></custom-block></block></block></script><list></list></block><block s="doReport"><block s="reportCONS"><custom-block s="inner product helper with %repRing . %repRing %l %br transposed %l"><block var="plus"/><block var="times"/><block s="reportListItem"><l>1</l><block var="a"/></block><block var="tb"/></custom-block><custom-block s="inner product helper with %repRing . %repRing %l %br transposed %l"><block var="plus"/><block var="times"/><block s="reportCDR"><block var="a"/></block><block var="tb"/></custom-block></block></block></script></block-definition><block-definition s="transpose $⍉-1.5-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="168" collapsed="false">Takes a multidimensional array, and&#xD;reports an array whose dimensions&#xD;are reversed (as reported by&#xD;SHAPE OF).  In the case of a&#xD;two-dimensional array, does the usual transposition of rows and columns.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>dta_transpose(list)</l><list><block var="array"/></list></block></block></script></block-definition><block-definition s="reverse row order (column contents) $⦵-1.5-255-255-0 %&apos;list&apos;" type="reporter" category="lists"><comment x="0" y="0" w="286" collapsed="false">Reverses the order of the (toplevel) items of the input.&#xD;&#xD;If the input is a matrix, this means it reverses the order of the rows, which is a reflection through a horizontal axis, as the ⦵ symbol suggests.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListAttribute"><l><option>reverse</option></l><block var="list"/></block></block></script></block-definition><block-definition s="multimap %&apos;function&apos; %&apos;data&apos;" type="reporter" category="other" helper="true"><comment x="0" y="0" w="215.33333333333334" collapsed="false">Like MAP, but can take any number of lists&#xD;as inputs.  The lists must all be the same size.&#xD;The function input must take a number of inputs&#xD;equal to the number of lists.  MULTIMAP calls&#xD;the function with all the first items, then all the&#xD;second items, and so on.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%mult%l"></input></inputs><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>lengths</l><l>cols</l></list></block><block s="doSetVar"><l>lengths</l><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportListAttribute"><l><option>length</option></l><l/></block></autolambda><list></list></block><block var="data"/></block></block><block s="doFor"><l>i</l><l>2</l><block s="reportListAttribute"><l><option>length</option></l><block var="lengths"/></block><script><block s="doIf"><block s="reportNot"><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><block var="lengths"/></block><block s="reportListItem"><block var="i"/><block var="lengths"/></block></list></block></block><script><custom-block s="error %txt"><l>Non-conforming shapes.</l></custom-block></script><list></list></block></script></block><block s="doSetVar"><l>cols</l><block s="reportListAttribute"><l><option>columns</option></l><block var="data"/></block></block><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="function"/><custom-block s="%s"><l></l></custom-block></block></autolambda><list></list></block><block var="cols"/></block></block></script></block></script></block-definition><block-definition s="generalized dotproduct %&apos;a&apos; %&apos;b&apos; with sum %&apos;sum&apos; product %&apos;product&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input><input type="%repRing"></input><input type="%repRing"></input></inputs><script><block s="doReport"><block s="reportCombine"><custom-block s="multimap %repRing %mult%l"><block var="product"/><list><block var="a"/><block var="b"/></list></custom-block><block var="sum"/></block></block></script></block-definition><block-definition s="inner product %&apos;a&apos; %&apos;plus&apos; $.-1-255-255-0 %&apos;times&apos; %&apos;b&apos;" type="reporter" category="lists"><comment x="0" y="0" w="252.66666666666666" collapsed="false">Computes a generalized matrix multiplication.&#xD;&#xD;In normal matrix multiplication, each cell of the result&#xD;is computed by multiplying individual numbers within&#xD;a row of the left input and a column of the right input,&#xD;and then adding those products.  In APL terms this is&#xD;+.× (&quot;plus dot times&quot;)&#xD;Any dyadic functions can replace addition and multiplication in this algorithm; a common case is&#xD;∨.∧ (&quot;or dot and&quot;)</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%repRing"></input><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="a"/><l><option>list</option></l></block></block><script><block s="doSetVar"><l>a</l><block s="reportNewList"><list><block var="a"/></list></block></block></script><list></list></block><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="b"/><l><option>list</option></l></block></block><script><block s="doSetVar"><l>b</l><block s="reportNewList"><list><block var="b"/></list></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><block s="reportListItem"><l><option>last</option></l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="a"/></custom-block></block><l>1</l></list></block><block s="reportVariadicGreaterThan"><list><block s="reportListItem"><l>1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="b"/></custom-block></block><l>1</l></list></block></list></block><script><block s="doDeclareVariables"><list><l>ta</l></list></block><block s="doSetVar"><l>ta</l><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block var="a"/></custom-block></block><block s="doSetVar"><l>a</l><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block var="ta"/></autolambda><list></list></block><block s="reportNumbers"><l>1</l><block s="reportListItem"><l>1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="b"/></custom-block></block></block></block></custom-block></block></script><list></list></block><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportVariadicGreaterThan"><list><block s="reportListItem"><l><option>last</option></l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="a"/></custom-block></block><l>1</l></list></block><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="b"/></custom-block></block><l>1</l></list></block></list></block><script><block s="doSetVar"><l>b</l><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block var="b"/></autolambda><list></list></block><block s="reportNumbers"><l>1</l><block s="reportListItem"><l><option>last</option></l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="a"/></custom-block></block></block></block></block></script><list></list></block><block s="doReport"><custom-block s="inner product helper with %repRing . %repRing %l %br transposed %l"><block var="plus"/><block var="times"/><block var="a"/><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block var="b"/></custom-block></custom-block></block></script></block-definition><block-definition s="min %&apos;a&apos; $⌊-1.2-255-255-0 %&apos;b&apos;" type="reporter" category="operators"><comment x="0" y="0" w="211.33333333333334" collapsed="true">Reports the smaller of its two inputs.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportVariadicMin"><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="combine in rows (reduce by column vectors) %&apos;func&apos; $/-1-255-255-0 %&apos;stuff&apos;" type="reporter" category="lists"><comment x="0" y="0" w="288.6666666666667" collapsed="false">This function has two names because there are two ways&#xD;to understand it.&#xD;&#xD;Lisp way:  A matrix is a list of rows.  This block combines the numbers in each row, producing one value for the entire row.&#xD;&#xD;APL way:  A matrix is made of vectors.  This block takes each column as a vector, and does vector arithmetic on the columns, producing one column as the result.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIfElse"><block s="reportVariadicGreaterThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="stuff"/></custom-block><l>1</l></list></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="combine in rows (reduce by column vectors) %repRing $/-1-255-255-0 %l"><block var="func"/><l/></custom-block></autolambda><list></list></block><block var="stuff"/></block></block></script><script><block s="doReport"><block s="reportCombine"><block var="stuff"/><block var="func"/></block></block></script></block></script></block-definition><block-definition s="%&apos;howmany&apos; deal helper %&apos;data&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doWarp"><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="howmany"/><l>0</l></list></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><list></list></block><block s="doDeclareVariables"><list><l>choices</l><l>index</l></list></block><block s="doSetVar"><l>choices</l><block s="reportNewList"><list></list></block></block><block s="doRepeat"><block var="howmany"/><script><block s="doSetVar"><l>index</l><block s="reportRandom"><l>1</l><block s="reportListAttribute"><l><option>length</option></l><block var="data"/></block></block></block><block s="doAddToList"><block s="reportListItem"><block var="index"/><block var="data"/></block><block var="choices"/></block><block s="doDeleteFromList"><block var="index"/><block var="data"/></block></script></block><block s="doReport"><block var="choices"/></block></script></block></script></block-definition><block-definition s="signum $×-1-255-255-0 %&apos;num&apos;" type="reporter" category="operators"><comment x="0" y="0" w="159.99999999999997" collapsed="false">Reports 1 if the input is positive,&#xD;0 if the input is zero,&#xD;or -1 if the input is negative.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doIf"><block s="reportIsA"><block var="num"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="signum $×-1-255-255-0 %n"><l></l></custom-block></autolambda><list></list></block><block var="num"/></block></block></script><list></list></block><block s="doIf"><block s="reportListContainsItem"><block s="reportNewList"><list><l>0</l><block s="reportBoolean"><l><bool>false</bool></l></block></list></block><block var="num"/></block><script><block s="doReport"><l>0</l></block></script><list></list></block><block s="doReport"><block s="reportQuotient"><block var="num"/><block s="reportMonadic"><l><option>abs</option></l><block var="num"/></block></block></block></script></block-definition><block-definition s="reciprocal $÷-1-255-255-0 %&apos;num&apos;" type="reporter" category="operators"><comment x="0" y="0" w="102.66666666666667" collapsed="false">reports 1 divided&#xD;by its input.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportQuotient"><l>1</l><block var="num"/></block></block></script></block-definition><block-definition s="roll $?-1-255-255-0 %&apos;num&apos;" type="reporter" category="operators"><comment x="0" y="0" w="180.66666666666666" collapsed="false">This block reports a random integer between 1 and its input.  To roll more than one die, use (for three dice)&#xD;roll (reshape as 3 items of 6)&#xD;APL:  ?3⍴6&#xD;Don&apos;t use reshape as 3 items of (roll 6), because that would roll one die and report 3 copies of the same random roll. </comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportRandom"><l>1</l><block var="num"/></block></block></script></block-definition><block-definition s="NAND %&apos;a&apos; $⍲-1.4-255-255-0 %&apos;b&apos;" type="predicate" category="operators"><comment x="0" y="0" w="198.66666666666666" collapsed="false">Reports the not-and of its inputs, in the form&#xD;0 for false, 1 for true.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="NOT $&#126;-1-255-255-0 %s"><custom-block s="LCM (and) %n $∧-1.2-255-255-0 %n"><block var="a"/><block var="b"/></custom-block></custom-block></block></script></block-definition><block-definition s="NOR %&apos;a&apos; $⍱-1.4-255-255-0 %&apos;b&apos;" type="predicate" category="operators"><comment x="0" y="0" w="198.66666666666666" collapsed="false">Reports the not-and of its inputs, in the form&#xD;0 for false, 1 for true.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="NOT $&#126;-1-255-255-0 %s"><custom-block s="GCD (or) %n $∨-1.2-255-255-0 %n"><block var="a"/><block var="b"/></custom-block></custom-block></block></script></block-definition><block-definition s="%&apos;a&apos; ≤ %&apos;b&apos;" type="predicate" category="operators"><comment x="0" y="0" w="151.33333333333334" collapsed="true">Reports True if the left input is&#xD;less than or equal to the right input.&#xD;&#xD;Reports a Snap! Boolean, not an integer 0 or 1.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportVariadicLessThanOrEquals"><list><block var="a"/><block var="b"/></list></block><comment w="176.66666666666666" collapsed="true">This is the primitive version.</comment></block></script></block-definition><block-definition s="%&apos;a&apos; ≥ %&apos;b&apos;" type="predicate" category="operators"><comment x="0" y="0" w="152.66666666666666" collapsed="false">Reports True if the left input is&#xD;greater than than or equal to&#xD;the right input.&#xD;&#xD;Reports a Snap! Boolean, not an integer 0 or 1.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportVariadicGreaterThanOrEquals"><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="XOR %&apos;a&apos; $≠-1-255-255-0 %&apos;b&apos;" type="predicate" category="operators"><comment x="0" y="0" w="190" collapsed="false">Reports False if its inputs are equal;&#xD;reports True if its inputs are not equal.&#xD;The inputs can have any non-list values.&#xD;(Lists are hyperized.)  If the inputs are&#xD;Booleans (True/False or 1/0), this is&#xD;also the exclusive-or function.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="%s scalar %s %s"><block var="a"/><l>≠</l><block var="b"/></custom-block></block></script></block-definition><block-definition s="truth %&apos;n&apos;" type="predicate" category="other" helper="true"><comment x="0" y="0" w="198.66666666666666" collapsed="false">Reports a Snap! Boolean False if the input&#xD;is False or 0; reports True otherwise.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doIf"><block s="reportIsA"><block var="n"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="truth %s"><l></l></custom-block></autolambda><list></list></block><block var="n"/></block></block></script><list></list></block><block s="doReport"><block s="reportIfElse"><block s="reportIsA"><block var="n"/><l><option>Boolean</option></l></block><block var="n"/><block s="reportNot"><block s="reportVariadicEquals"><list><block var="n"/><l>0</l></list></block></block></block></block></script></block-definition><block-definition s="make scalar %&apos;value&apos;" type="reporter" category="operators" helper="true"><comment x="0" y="0" w="242.66666666666666" collapsed="false">Turns list of list of ... a single scalar (e.g., ((((x)))) ) into just the scalar.  Error if called with anything else.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="scalar? %s"><block var="value"/></custom-block><script><block s="doReport"><custom-block s="scalar-value helper %s"><block var="value"/></custom-block></block></script><list></list></block><custom-block s="error %txt"><block s="reportJoinWords"><list><l>Make scalar called with non-singleton input </l><block var="value"/></list></block></custom-block></script></block-definition><block-definition s="$⍳-1.5-255-255-0 %&apos;n&apos;" type="reporter" category="lists"><comment x="0" y="0" w="290.6666666666667" collapsed="false">If the input is a positive integer, reports a list of the numbers&#xD;from 1 to that input.  (If the input is 0, reports an empty list.)&#xD;&#xD;If the input is a list of positive integers, reports an array with&#xD;the shape specified by the input (as in ⍴ reshape) in which&#xD;each item is a list of the indices of that item in the array&#xD;(so technically the shape has one more dimension&#xD;than the input, whose size is the size of the input).&#xD;&#xD;If the input is a list that includes 0, the result is an array whose shape is the part of the input list before the 0, in which every element is empty.  If you&apos;d like some other value in every element, MD-MAP a constant function over the result.&#xD;&#xD;For list inputs, the size of the result grows very quickly, more or less the factorial of the size of the input.  Snap! will not attempt to compute a result bigger than a few million atomic items.&#xD;⍳(⍳ 9) will work (≈ 3 million atoms) but ⍳(⍳ 10) will give an error.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="n"/><l><option>list</option></l></block><script><block s="doIfElse"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="n"/></custom-block><l>1</l></list></block><script><block s="doIfElse"><block s="reportListContainsItem"><block var="n"/><l>0</l></block><script><block s="doReport"><block s="reportReshape"><block s="reportNewList"><list></list></block><block s="reportListItem"><block s="reportNumbers"><l>1</l><block s="reportDifference"><block s="reportListIndex"><l>0</l><block var="n"/></block><l>1</l></block></block><block var="n"/></block></block></block></script><script><block s="doReport"><block s="reportReshape"><custom-block s="crossproduct %mult%l"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportNumbers"><l>1</l><l></l></block></autolambda><list></list></block><block var="n"/></block></custom-block><block s="reportConcatenatedLists"><list><block var="n"/><block s="reportNewList"><list><block s="reportListAttribute"><l><option>length</option></l><block var="n"/></block></list></block></list></block></block></block></script></block></script><script><custom-block s="error %txt"><l>Input to ⍳ can&apos;t be a list of lists.</l></custom-block></script></block></script><script><block s="doReport"><block s="reportIfElse"><custom-block s="zero? %n"><block var="n"/></custom-block><block s="reportNewList"><list></list></block><block s="reportNumbers"><l>1</l><block var="n"/></block></block></block></script></block></script></block-definition><block-definition s="where in %&apos;vector&apos; is $⍳-1.5-255-255-0 %&apos;items&apos;" type="reporter" category="lists"><comment x="0" y="0" w="334.6666666666667" collapsed="false">If the rank of the left input is one more than the rank of the right input,&#xD;reports the index of the right input in the left input, or if not found,&#xD;reports one more than the length of the left input.&#xD;&#xD;If the rank of the left input is equal to the rank of the right input,&#xD;reports a vector of the indices of the items of the right input&#xD;in the left input (mapping this function over the right input).&#xD;&#xD;If the rank of the left input is more than that of the right input by 2 or more,&#xD;reports a vector, the location of the right input in the left in each dimension.&#xD;&#xD;It is an error if the rank of the left input is less than that of the right input.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doIf"><block s="reportVariadicLessThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="vector"/></custom-block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="items"/></custom-block></list></block><script><custom-block s="error %txt"><l>Left input to ⍳ must have greater or equal rank to right input.</l></custom-block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="vector"/></custom-block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="items"/></custom-block></list></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="where in %l is $⍳-1.5-255-255-0 %s"><block var="vector"/><l></l></custom-block></autolambda><list></list></block><block var="items"/></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="vector"/></custom-block><block s="reportVariadicSum"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="items"/></custom-block><l>1</l></list></block></list></block><script><block s="doSetVar"><l>result</l><block s="reportListIndex"><block var="items"/><block var="vector"/></block></block><block s="doReport"><block s="reportIfElse"><custom-block s="zero? %n"><block var="result"/></custom-block><block s="reportVariadicSum"><list><block s="reportListAttribute"><l><option>length</option></l><block var="vector"/></block><l>1</l></list></block><block var="result"/></block></block></script><list></list></block><block s="doSetVar"><l>result</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><custom-block s="%l deep contains %s"><l/><block var="items"/></custom-block></autolambda><list></list></block><block var="vector"/></block></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="result"/><l></l></list></block><script><block s="doReport"><block s="reportVariadicSum"><list><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="vector"/></custom-block><l>1</l></list></block></block></script><list></list></block><block s="doReport"><block s="reportCONS"><block s="reportListIndex"><block var="result"/><block var="vector"/></block><custom-block s="flatten (ravel) $,-1-255-255-0 %l"><custom-block s="where in %l is $⍳-1.5-255-255-0 %s"><block var="result"/><block var="items"/></custom-block></custom-block></block></block></script></block-definition><block-definition s="crossproduct %&apos;lists&apos;" type="reporter" category="lists"><comment x="0" y="0" w="305.3333333333333" collapsed="false">This isn&apos;t an APL function, although it&apos;s related to the outer product.&#xD;&#xD;It takes any number of lists, and reports a list of all possible tuples with one item from each of the lists.  The length of the result is the product of the lengths of the inputs.&#xD;&#xD;The result gets very big very quickly.  Snap! will refuse to do this computation if the result would be more than a few million atomic items.  (crossproduct (⍳(⍳9))) makes about 3 million atomic items; (crossproduct (⍳(⍳10))) gives an error message.</comment><header></header><code></code><translations></translations><inputs><input type="%mult%l"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>dta_crossproduct(list)</l><list><block var="lists"/></list></block></block></script></block-definition><block-definition s="%&apos;array&apos; deep contains %&apos;value&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%s"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="array"/><l><option>list</option></l></block></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doIf"><block s="reportListContainsItem"><block var="array"/><block var="value"/></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="doReport"><custom-block s="combine in rows (reduce by column vectors) %repRing $/-1-255-255-0 %l"><block s="reifyReporter"><autolambda><block s="reportVariadicOr"><list><l/><l/></list></block></autolambda><list></list></block><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="%l deep contains %s"><l/><block var="value"/></custom-block></autolambda><list></list></block><block var="array"/></block></custom-block></block></script></block-definition><block-definition s="which of %&apos;items&apos; $ϵ-1-255-255-0 contained in %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="214.66666666666666" collapsed="false">Reports an array of Booleans the same shape&#xD;as the left input, indicating which of the atoms&#xD;in the left input appear anywhere in the right&#xD;input.  &#xD;(The structure of the right input doesn&apos;t matter.)</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="items"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><custom-block s="which of %s $ϵ-1-255-255-0 contained in %l"><l></l><custom-block s="flatten (ravel) $,-1-255-255-0 %l"><block var="array"/></custom-block></custom-block></autolambda><list></list></block><block var="items"/></block></block></script><script><block s="doReport"><block s="reportListContainsItem"><custom-block s="flatten (ravel) $,-1-255-255-0 %l"><block var="array"/></custom-block><block var="items"/></block></block></script></block></script></block-definition><block-definition s="catenate %&apos;left&apos; $,-1-255-255-0 %&apos;right&apos;" type="reporter" category="lists"><comment x="0" y="0" w="190.66666666666666" collapsed="false">Like append, but:&#xD;&#xD;A scalar input is treated as an array the same shape as the other input except that the last item of the shape is 1.&#xD;&#xD;If the two inputs are of different ranks,&#xD;the function is mapped over the larger ranked input.&#xD;&#xD;Catenate adds new columns, by appending to each row.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="left"/><l><option>list</option></l></block></block><script><block s="doIfElse"><block s="reportVariadicGreaterThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="right"/></custom-block><l>1</l></list></block><script><block s="doSetVar"><l>left</l><custom-block s="reshape as %l $⍴-1-255-255-0 items of %l"><block s="reportConcatenatedLists"><list><custom-block s="drop %n $↓-1-255-255-0 from %l"><l>-1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="right"/></custom-block></custom-block><block s="reportNewList"><list><l>1</l></list></block></list></block><block s="reportNewList"><list><block var="left"/></list></block></custom-block></block></script><script><block s="doSetVar"><l>left</l><block s="reportNewList"><list><block var="left"/></list></block></block></script></block></script><list></list></block><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="right"/><l><option>list</option></l></block></block><script><block s="doIfElse"><block s="reportVariadicGreaterThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><l>1</l></list></block><script><block s="doSetVar"><l>right</l><custom-block s="reshape as %l $⍴-1-255-255-0 items of %l"><block s="reportConcatenatedLists"><list><custom-block s="drop %n $↓-1-255-255-0 from %l"><l>-1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="left"/></custom-block></custom-block><block s="reportNewList"><list><l>1</l></list></block></list></block><block s="reportNewList"><list><block var="right"/></list></block></custom-block></block></script><script><block s="doSetVar"><l>right</l><block s="reportNewList"><list><block var="right"/></list></block></block></script></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="right"/></custom-block></list></block><script><block s="doIfElse"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><l>1</l></list></block><script><block s="doReport"><block s="reportConcatenatedLists"><list><block var="left"/><block var="right"/></list></block></block></script><script><block s="doReport"><custom-block s="multimap %repRing %mult%l"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><l></l><l></l></custom-block></autolambda><list></list></block><list><block var="left"/><block var="right"/></list></custom-block></block></script></block></script><list></list></block><block s="doIfElse"><block s="reportVariadicLessThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="right"/></custom-block></list></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><block var="left"/><l></l></custom-block></autolambda><list></list></block><block var="right"/></block></block></script><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><l></l><block var="right"/></custom-block></autolambda><list></list></block><block var="left"/></block></block></script></block></script></block-definition><block-definition s="scalar value %&apos;value&apos;" type="reporter" category="lists"><comment x="0" y="0" w="221.33333333333334" collapsed="false">If the input is a nesting of length=1 lists, which&#xD;APL treats as a scalar (the innermost item)&#xD;for many purposes, report that innermost scalar.&#xD;Otherwise, report the input as is.&#xD;&#xD;Exposing this block for users is important because Snap! /does not/ treat such a nesting&#xD;as a scalar, so you might need to use this in&#xD;translating an APL program to Snap!.&#xD;(But the functions in the APL library already use&#xD;this block as needed.)</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="reportIfElse"><custom-block s="scalar? %s"><block var="value"/></custom-block><custom-block s="scalar-value helper %s"><block var="value"/></custom-block><block var="value"/></block></block></script></block-definition><block-definition s="grade up $⍋-1.5-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="190.66666666666666" collapsed="false">Reports a vector of indices of the items of the input, in order of the values of the items, so that&#xD;&#xD;item (grade up (foo)) of (foo)&#xD;&#xD;reports the items in sorted order, smallest to largest.  For a matrix, sorts the rows based on their first items, or if those are equal, based on their second items, etc.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><l><option>last</option></l><l/></block></autolambda><list></list></block><custom-block s="$flash sort %l ordering with %predRing"><custom-block s="multimap %repRing over %mult%l"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><l></l><l></l></custom-block></autolambda><list></list></block><list><block var="array"/><custom-block s="$⍳-1.5-255-255-0 %n"><block s="reportListAttribute"><l><option>length</option></l><block var="array"/></block></custom-block></list></custom-block><block s="reifyPredicate"><autolambda><custom-block s="sort helper %l %l"><l/><l/></custom-block></autolambda><list></list></block></custom-block></block></block></script></block-definition><block-definition s="sort helper %&apos;rowA&apos; %&apos;rowB&apos;" type="reporter" category="other" helper="true"><comment x="0" y="0" w="166" collapsed="false">Compares two vectors for sorting.&#xD;Compare first items; if those are equal compare second items; etc.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="rowA"/></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="doIf"><block s="reportListIsEmpty"><block var="rowB"/></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicLessThan"><list><block s="reportListItem"><l>1</l><block var="rowA"/></block><block s="reportListItem"><l>1</l><block var="rowB"/></block></list></block><script><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicGreaterThan"><list><block s="reportListItem"><l>1</l><block var="rowA"/></block><block s="reportListItem"><l>1</l><block var="rowB"/></block></list></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doReport"><custom-block s="sort helper %l %l"><block s="reportCDR"><block var="rowA"/></block><block s="reportCDR"><block var="rowB"/></block></custom-block></block></script></block-definition><block-definition s="grade down $⍒-1.5-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="190.66666666666666" collapsed="false">Reports a vector of indices of the items of the input, in order of the values of the items, so that&#xD;&#xD;item (grade down (foo)) of (foo)&#xD;&#xD;reports the items in sorted order, largest to smallest.  For a matrix, sorts the rows based on their first items, or if those are equal, based on their second items, etc.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><l><option>last</option></l><l/></block></autolambda><list></list></block><custom-block s="$flash sort %l ordering with %predRing"><custom-block s="multimap %repRing over %mult%l"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><l></l><l></l></custom-block></autolambda><list></list></block><list><block var="array"/><custom-block s="$⍳-1.5-255-255-0 %n"><block s="reportListAttribute"><l><option>length</option></l><block var="array"/></block></custom-block></list></custom-block><block s="reifyPredicate"><autolambda><custom-block s="NOT $&#126;-1-255-255-0 %s"><custom-block s="sort helper %l %l"><l/><l/></custom-block></custom-block></autolambda><list></list></block></custom-block></block></block></script></block-definition><block-definition s="select rows (compress columns) %&apos;Booleans&apos; $/-1-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="210.66666666666666" collapsed="false">The left input must be a vector of Booleans&#xD;(either Snap! form or APL form); the right input must be an array whose first dimension is equal to the length of the left input.  The block reports an array of the same rank as the right input, containing only those items (rows, for a matrix) for which the corresponding Boolean is True (or 1).</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="rowize vector %l"><block s="reportAtomicKeep"><block s="reifyPredicate"><autolambda><custom-block s="truth %s"><block s="reportListItem"><block var="index"/><block var="Booleans"/></block></custom-block></autolambda><list><l>value</l><l>index</l></list></block><block var="array"/></block></custom-block></block></script></block-definition><block-definition s="rowize vector %&apos;vec&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="vec"/></custom-block><l>2</l></list></block><block s="reportVariadicEquals"><list><block s="reportListItem"><l>2</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="vec"/></custom-block></block><l>1</l></list></block></list></block><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>1</l><l/></block></autolambda><list></list></block><block var="vec"/></block><block var="vec"/></block></block></script></block-definition><block-definition s="select columns (compress rows) %&apos;bool&apos; $⌿-1.5-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="219.33333333333334" collapsed="false">The left input must be a vector of Booleans&#xD;(either Snap! form or APL form); the right input must be an array whose last dimension is equal to the length of the left input.  The block reports an array of the same rank as the right input, containing only those items (columns, for a matrix) for which the corresponding Boolean is True (or 1).</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="columnwise %repRing %l"><block s="reifyReporter"><autolambda><custom-block s="select rows (compress columns) %l $/-1-255-255-0 %l"><block var="bool"/><l/></custom-block></autolambda><list></list></block><block var="array"/></custom-block></block></script></block-definition><block-definition s="columnwise %&apos;function&apos; %&apos;data&apos;" type="reporter" category="control" helper="true"><comment x="0" y="0" w="212" collapsed="false">Turns a row-wise (in Lisp terminology) function&#xD;into a column-wise one.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="rowize vector %l"><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block s="evaluate"><block var="function"/><list><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block var="data"/></custom-block></list></block></custom-block></custom-block></block></script></block-definition><block-definition s="reverse column order (row contents) $⏀-1-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="206" collapsed="false">Reverses the order of the columns of the input, which is a reflection through a vertical axis, as the ⏀ symbol suggests.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="columnwise %repRing %l"><block s="reifyReporter"><autolambda><custom-block s="reverse row order (column contents) $⦵-1.5-255-255-0 %l"><l/></custom-block></autolambda><list></list></block><block var="array"/></custom-block></block></script></block-definition><block-definition s="combine in columns (reduce by row vectors) %&apos;function&apos; $⌿-1.5-255-255-0 %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="285.3333333333333" collapsed="false">This function has two names because there are two ways&#xD;to understand it.&#xD;&#xD;Lisp way:  A matrix is a list of rows.  This block turns it into a list of columns, and combines the numbers in each column, producing one value for the entire column.&#xD;&#xD;APL way:  A matrix is made of vectors.  This block takes each row as a vector, and does vector arithmetic on the rows, producing one row as the result.</comment><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="columnwise %repRing %l"><block s="reifyReporter"><autolambda><custom-block s="combine in rows (reduce by column vectors) %repRing $/-1-255-255-0 %l"><block var="function"/><l/></custom-block></autolambda><list></list></block><block var="array"/></custom-block></block></script></block-definition><block-definition s="catenate vertically %&apos;left&apos; $⍪-1.5-255-255-0 %&apos;right&apos;" type="reporter" category="lists"><comment x="0" y="0" w="190.66666666666666" collapsed="false">Like append, but:&#xD;&#xD;A scalar input is treated as a vector&#xD;of length 1.&#xD;&#xD;If the two inputs are of different ranks,&#xD;the function is mapped over the larger ranked input.&#xD;&#xD;Catenate vertically adds new rows, by appending to each column.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="left"/><l><option>list</option></l></block></block><script><block s="doIfElse"><block s="reportVariadicGreaterThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="right"/></custom-block><l>1</l></list></block><script><block s="doSetVar"><l>left</l><custom-block s="reshape as %l $⍴-1-255-255-0 items of %l"><block s="reportConcatenatedLists"><list><block s="reportNewList"><list><l>1</l></list></block><custom-block s="drop %n $↓-1-255-255-0 from %l"><l>1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="right"/></custom-block></custom-block></list></block><block s="reportNewList"><list><block var="left"/></list></block></custom-block></block></script><script><block s="doSetVar"><l>left</l><block s="reportNewList"><list><block var="left"/></list></block></block></script></block></script><list></list></block><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="right"/><l><option>list</option></l></block></block><script><block s="doIfElse"><block s="reportVariadicGreaterThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><l>1</l></list></block><script><block s="doSetVar"><l>right</l><custom-block s="reshape as %l $⍴-1-255-255-0 items of %l"><block s="reportConcatenatedLists"><list><block s="reportNewList"><list><l>1</l></list></block><custom-block s="drop %n $↓-1-255-255-0 from %l"><l>1</l><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="left"/></custom-block></custom-block></list></block><block s="reportNewList"><list><block var="right"/></list></block></custom-block></block></script><script><block s="doSetVar"><l>right</l><block s="reportNewList"><list><block var="right"/></list></block></block></script></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="right"/></custom-block></list></block><script><block s="doIfElse"><block s="reportVariadicEquals"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><l>1</l></list></block><script><block s="doReport"><block s="reportConcatenatedLists"><list><block var="left"/><block var="right"/></list></block></block></script><script><block s="doReport"><custom-block s="transpose $⍉-1.5-255-255-0 %l"><custom-block s="catenate %s $,-1-255-255-0 %s"><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block var="left"/></custom-block><custom-block s="transpose $⍉-1.5-255-255-0 %l"><block var="right"/></custom-block></custom-block></custom-block></block></script></block></script><list></list></block><block s="doIfElse"><block s="reportVariadicLessThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="left"/></custom-block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="right"/></custom-block></list></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><block var="left"/><l></l></custom-block></autolambda><list></list></block><block var="right"/></block></block></script><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="catenate %s $,-1-255-255-0 %s"><l></l><block var="right"/></custom-block></autolambda><list></list></block><block var="left"/></block></block></script></block></script><scripts><script x="254" y="497.7777777777774"><custom-block s="multimap %repRing %mult%l"><block s="reifyReporter"><script></script><list></list></block><list><l/><l/></list></custom-block></script></scripts></block-definition><block-definition s="%&apos;a&apos; scalar join %&apos;b&apos;" type="reporter" category="operators"><comment x="0" y="0" w="219.33333333333334" collapsed="false">A hyperblock version of JOIN.  The regular JOIN isn&apos;t hyperized because it can accept a list as input, representing it as text.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l></l></list></block></autolambda><list></list></block></custom-block><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="take %&apos;howmany&apos; $↑-1-255-255-0 from %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="272" collapsed="false">A positive left input selects the first n items of the right input.&#xD;A negative left input selects the last abs(n) items&#xD;of the right input.&#xD;&#xD;If the right input is a matrix, a numeric left input selects rows;&#xD;the left input may also be a two-item vector, in which case&#xD;the first number is applied to the rows&#xD;and the second number is applied to the columns.&#xD;Similarly for higher-dimension arrays. </comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportIsA"><block var="howmany"/><l><option>number</option></l></block><script><block s="doReport"><block s="reportIfElse"><block s="reportVariadicLessThan"><list><block var="howmany"/><l>0</l></list></block><block s="reportListItem"><block s="reportVariadicSum"><list><custom-block s="$⍳-1.5-255-255-0 %n"><block s="reportMonadic"><l><option>abs</option></l><block var="howmany"/></block></custom-block><block s="reportVariadicSum"><list><block s="reportListAttribute"><l><option>length</option></l><block var="array"/></block><block var="howmany"/></list></block></list></block><block var="array"/></block><block s="reportListItem"><custom-block s="$⍳-1.5-255-255-0 %n"><block var="howmany"/></custom-block><block var="array"/></block></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicGreaterThan"><list><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="howmany"/></custom-block><l>1</l></list></block><script><custom-block s="error %txt"><l>Left input to take can&apos;t be a matrix.</l></custom-block></script><list></list></block><block s="doIf"><block s="reportVariadicGreaterThan"><list><block s="reportListAttribute"><l><option>length</option></l><block var="howmany"/></block><custom-block s="rank of $⍴⍴-1-255-255-0 %l"><block var="array"/></custom-block></list></block><script><custom-block s="error %txt"><l>Length of item vector &gt; rank of array in take.</l></custom-block></script><list></list></block><block s="doReport"><block s="reportListItem"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportIfElse"><block s="reportVariadicLessThan"><list><block var="value"/><l>0</l></list></block><block s="reportVariadicSum"><list><custom-block s="$⍳-1.5-255-255-0 %n"><block s="reportMonadic"><l><option>abs</option></l><block var="value"/></block></custom-block><block s="reportVariadicSum"><list><block s="reportListItem"><block var="index"/><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="array"/></custom-block></block><block var="value"/></list></block></list></block><custom-block s="$⍳-1.5-255-255-0 %n"><block var="value"/></custom-block></block></autolambda><list><l>value</l><l>index</l></list></block><block var="howmany"/></block><block var="array"/></block></block></script></block-definition><block-definition s="drop %&apos;howmany&apos; $↓-1-255-255-0 from %&apos;array&apos;" type="reporter" category="lists"><comment x="0" y="0" w="306" collapsed="false">A positive left input selects all but the first n items of the right input.&#xD;A negative left input selects all but the last abs(n) items&#xD;of the right input.&#xD;&#xD;If the right input is a matrix, a numeric left input selects rows;&#xD;the left input may also be a two-item vector, in which case&#xD;the first number is applied to the rows&#xD;and the second number is applied to the columns.&#xD;Similarly for higher-dimension arrays. </comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportIsA"><block var="howmany"/><l><option>number</option></l></block><script><block s="doReport"><custom-block s="take %n $↑-1-255-255-0 from %l"><block s="reportVariadicProduct"><list><block s="reportMonadic"><l><option>neg</option></l><custom-block s="signum $×-1-255-255-0 %n"><block var="howmany"/></custom-block></block><block s="reportDifference"><block s="reportListAttribute"><l><option>length</option></l><block var="array"/></block><block s="reportMonadic"><l><option>abs</option></l><block var="howmany"/></block></block></list></block><block var="array"/></custom-block></block></script><list></list></block><block s="doReport"><custom-block s="take %n $↑-1-255-255-0 from %l"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportIfElse"><block s="reportVariadicLessThan"><list><block var="value"/><l>0</l></list></block><block s="reportVariadicSum"><list><block s="reportListItem"><block var="index"/><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="array"/></custom-block></block><block var="value"/></list></block><block s="reportDifference"><block var="value"/><block s="reportListItem"><block var="index"/><custom-block s="shape of $⍴-1-255-255-0 %l"><block var="array"/></custom-block></block></block></block></autolambda><list><l>value</l><l>index</l></list></block><block var="howmany"/></block><block var="array"/></custom-block></block></script></block-definition><block-definition s="error %&apos;msg&apos;" type="command" category="control"><comment x="0" y="0" w="268.6666666666667" collapsed="false">Throw an error.&#xD;&#xD;Makes a red halo appear around the script that runs it,&#xD;with the input text shown in a speech balloon next to&#xD;the script, just like any Snap! error.&#xD;&#xD;This is useful to put in the second script of SAFELY TRY&#xD;after some other instructions to undo the partial work of&#xD;the first script.</comment><header></header><code></code><translations>pt:lança o erro _&#xD;</translations><inputs><input type="%txt"></input></inputs><script><block s="doApplyExtension"><l>err_error(msg)</l><list><block var="msg"/></list></block></script></block-definition><block-definition s="simple log base %&apos;b&apos; of %&apos;n&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportQuotient"><block s="reportMonadic"><l><option>ln</option></l><block var="n"/></block><block s="reportMonadic"><l><option>ln</option></l><block var="b"/></block></block></block></script></block-definition><block-definition s="simple permutations of %&apos;r&apos; items out of %&apos;n&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block var="r"/><l>0</l></list></block><l>1</l><block s="reportAtomicCombine"><block s="reportNumbers"><block s="reportVariadicSum"><list><block s="reportDifference"><block var="n"/><block var="r"/></block><l>1</l></list></block><block var="n"/></block><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><l></l><l></l></list></block></autolambda><list></list></block></block></block></block></script></block-definition><block-definition s="simple combs %&apos;r&apos; out of %&apos;n&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportQuotient"><custom-block s="simple permutations of %n items out of %n"><block var="r"/><block var="n"/></custom-block><custom-block s="factorial $!-1-255-255-0 %n"><block var="r"/></custom-block></block></block></script></block-definition><block-definition s="numbers from %&apos;from&apos; to %&apos;to&apos; ascending" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="simple numbers from %n to %n ascending"><l></l><l></l></custom-block></autolambda><list></list></block></custom-block><list><block var="from"/><block var="to"/></list></block></block></script></block-definition><block-definition s="simple lcm %&apos;a&apos; %&apos;b&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="b"/><l>0</l></list></block><script><block s="doReport"><block var="b"/></block></script><list></list></block><block s="doReport"><block s="reportVariadicProduct"><list><block var="a"/><block s="reportQuotient"><block var="b"/><custom-block s="simple gcd %n %n"><block var="a"/><block var="b"/></custom-block></block></list></block></block></script></block-definition><block-definition s="simple numbers from %&apos;from&apos; to %&apos;to&apos; ascending" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportVariadicGreaterThan"><list><block var="from"/><block var="to"/></list></block><block s="reportNewList"><list></list></block><block s="reportNumbers"><block var="from"/><block var="to"/></block></block></block></script></block-definition><block-definition s="☠︎ linked? %&apos;data&apos;" type="predicate" category="lists" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>lst_linked(list)</l><list><block var="data"/></list></block></block></script></block-definition><block-definition s="☠︎ link %&apos;data&apos;" type="reporter" category="lists" helper="true"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="data"/></block><script><block s="doReport"><block var="data"/></block></script><list></list></block><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="data"/></block><block s="reportCDR"><block var="data"/></block></block></block></script></block-definition><block-definition s="printable %&apos;data&apos;" type="reporter" category="lists"><comment x="0" y="0" w="188.66666666666666" collapsed="false">Takes a (possibly deep) list as input,&#xD;and reports a human-readable text form &#xD;of the list (namely, Lisp notation).&#xD;&#xD;Will not work on circular lists.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="data"/><l><option>list</option></l></block></block><script><block s="doReport"><block var="data"/></block></script><list></list></block><block s="doIf"><block s="reportListIsEmpty"><block var="data"/></block><script><block s="doReport"><l>()</l></block></script><list></list></block><block s="doReport"><block s="reportJoinWords"><list><l>(</l><block s="reportAtomicCombine"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="printable %l"><l/></custom-block></autolambda><list></list></block><block var="data"/></block><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l> </l><l></l></list></block></autolambda><list></list></block></block><l>)</l></list></block></block></script></block-definition><block-definition s="log base %&apos;b&apos; $⍟-1.5-255-255-0 %&apos;x&apos;" type="reporter" category="operators"><comment x="0" y="0" w="212" collapsed="false">Computes logarithms in any base.&#xD;&#xD;The base is the left input.  It&apos;s usual in APL that if there&apos;s a main data input and some sort of control input, the latter comes on the left.  This is because APL syntax, unless you use parentheses, groups computations from right to left.&#xD;&#xD;APL has a monadic version of this function that computes natural logs (log to the base e).</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="simple log base %n of %n"><l></l><l></l></custom-block></autolambda><list></list></block></custom-block><list><block var="b"/><block var="x"/></list></block></block></script></block-definition><block-definition s="combs %&apos;r&apos; at a time $!-1-255-255-0 of %&apos;n&apos;" type="reporter" category="operators"><comment x="0" y="0" w="218.66666666666666" collapsed="false">Computes the number of combinations of right-input things taken left-input at a time, otherwise known as the elements of Pascal&apos;s triangle.  This block shares the ! symbol with the monadic factorial function, because the formula for computing this function uses factorials.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="simple combs %n out of %n"><l></l><l></l></custom-block></autolambda><list></list></block></custom-block><list><block var="r"/><block var="n"/></list></block></block></script></block-definition><block-definition s="factorial $!-1-255-255-0 %&apos;n&apos;" type="reporter" category="operators"><comment x="0" y="0" w="172.66666666666666" collapsed="false">The factorial of a positive integer n is the product of the integers from 1 to n.&#xD;&#xD;In real APL, the domain of this function is extended beyond integers to compute the gamma function.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="n"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="factorial $!-1-255-255-0 %n"><l></l></custom-block></autolambda><list></list></block><block var="n"/></block></block></script><script><block s="doReport"><block s="reportIfElse"><custom-block s="zero? %n"><block var="n"/></custom-block><l>1</l><block s="reportAtomicCombine"><block s="reportNumbers"><l>1</l><block var="n"/></block><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><l></l><l></l></list></block></autolambda><list></list></block></block></block></block></script></block></script></block-definition><block-definition s="%&apos;a&apos; scalar %&apos;pred&apos; %&apos;b&apos;" type="predicate" category="operators"><comment x="0" y="0" w="190" collapsed="false">Acts just like the function selected from&#xD;the pulldown menu, but hyperized, so&#xD;comparing two equal-sized lists reports&#xD;a list of the same length as the inputs,&#xD;with the results of item-by-item comparisons.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s" readonly="true">﹦<options>﹦&#xD;≠&#xD;identical to&#xD;and&#xD;or&#xD;is _ a _?</options></input><input type="%s"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reportListItem"><block s="reportListIndex"><block var="pred"/><block s="reportNewList"><list><l>﹦</l><l>≠</l><l>identical to</l><l>and</l><l>or</l><l>is _ a _?</l></list></block></block><block s="reportNewList"><list><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><l></l><l></l></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicNotEquals"><list><l></l><l></l></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicIsIdentical"><list><l></l><l></l></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicAnd"><list><l/><l/></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportVariadicOr"><list><l/><l/></list></block></autolambda><list></list></block><block s="reifyPredicate"><autolambda><block s="reportIsA"><l></l><l></l></block></autolambda><list></list></block></list></block></block></custom-block><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="LCM (and) %&apos;a&apos; $∧-1.2-255-255-0 %&apos;b&apos;" type="reporter" category="operators"><comment x="0" y="0" w="230.66666666666666" collapsed="false">Reports the least common multiple of its inputs.&#xD;If the inputs are values in {0,1} then this is equivalent to the logical AND of the values, with 0=False, 1=True.  Hence the APL symbol ∧.&#xD;Also accepts Snap! Booleans as inputs.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="simple lcm %n %n"><l></l><l></l></custom-block></autolambda><list></list></block></custom-block><list><custom-block s="de-boolean %s"><block var="a"/></custom-block><custom-block s="de-boolean %s"><block var="b"/></custom-block></list></block></block></script></block-definition><block-definition s="NOT $&#126;-1-255-255-0 %&apos;p&apos;" type="reporter" category="operators"><comment x="0" y="0" w="167.33333333333334" collapsed="false">Reports 1 if the input is False or 0;&#xD;otherwise reports 0.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="reportDifference"><l>1</l><custom-block s="signum $×-1-255-255-0 %n"><block s="reportMonadic"><l><option>abs</option></l><block var="p"/></block></custom-block></block></block></script></block-definition><block-definition s="permutations of %&apos;r&apos; items out of %&apos;n&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="simple permutations of %n items out of %n"><l></l><l></l></custom-block></autolambda><list></list></block></custom-block><list><block var="r"/><block var="n"/></list></block></block></script></block-definition><block-definition s="identity $+-1-255-255-0 %&apos;x&apos;" type="reporter" category="operators"><comment x="0" y="0" w="210.00000000000003" collapsed="false">Reports its input.&#xD;This is useful to fit a value into a different-type input slot, e.g., number into list slot.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block s="reportMonadic"><l><option>id</option></l><block var="x"/></block></block></script></block-definition><block-definition s="deep map %&apos;function&apos; over %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="data"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="deep map %repRing over %l"><block var="function"/><l/></custom-block></autolambda><list></list></block><block var="data"/></block></block></script><script><block s="doReport"><block s="evaluate"><block var="function"/><list><block var="data"/></list></block></block></script></block></script></block-definition><block-definition s="%&apos;howmany&apos; deal $?-1-255-255-0 %&apos;range&apos;" type="reporter" category="operators"><comment x="0" y="0" w="177.33333333333334" collapsed="false">Report a list with left-input random integers in the range 1 to right-input.&#xD;No number appears more than once&#xD;in the result.  The left input must be less than or equal to the right input.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="scalar -&gt; hyper %repRing"><block s="reifyReporter"><autolambda><custom-block s="%n deal helper %l"><l></l><block s="reportNumbers"><l>1</l><l></l></block></custom-block></autolambda><list></list></block></custom-block><list><block var="howmany"/><block var="range"/></list></block></block></script></block-definition><block-definition s="outer product %&apos;a&apos; $○.-1-255-255-0 %&apos;function&apos; %&apos;b&apos;" type="reporter" category="lists"><comment x="0" y="0" w="297.99999999999994" collapsed="false">Given two arrays A and B, reports an array whose dimensions are&#xD;APPEND(SHAPE OF (A), SHAPE OF (B))&#xD;in which each atomic item of the result is computed by applying the dyadic function input to an item of A and an item of B.</comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="a"/><l><option>list</option></l></block><script><block s="doIf"><block s="reportListIsEmpty"><block var="a"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><list></list></block><block s="doReport"><block s="reportCONS"><custom-block s="outer product %l $○.-1-255-255-0 %repRing %l"><block s="reportListItem"><l>1</l><block var="a"/></block><block var="function"/><block var="b"/></custom-block><custom-block s="outer product %l $○.-1-255-255-0 %repRing %l"><block s="reportCDR"><block var="a"/></block><block var="function"/><block var="b"/></custom-block></block></block></script><script><block s="doIfElse"><block s="reportIsA"><block var="b"/><l><option>list</option></l></block><script><block s="doIf"><block s="reportListIsEmpty"><block var="b"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><list></list></block><block s="doReport"><block s="reportCONS"><custom-block s="outer product %l $○.-1-255-255-0 %repRing %l"><block var="a"/><block var="function"/><block s="reportListItem"><l>1</l><block var="b"/></block></custom-block><custom-block s="outer product %l $○.-1-255-255-0 %repRing %l"><block var="a"/><block var="function"/><block s="reportCDR"><block var="b"/></block></custom-block></block></block></script><script><block s="doReport"><block s="evaluate"><block var="function"/><list><block var="a"/><block var="b"/></list></block></block></script></block></script></block></script></block-definition><block-definition s="parse code %&apos;code&apos; to blocks" type="reporter" category="operators"><comment x="0" y="0" w="104" collapsed="false">turn LISP syntax text code into blocks</comment><header></header><code></code><translations>de:verwandle Code _ in Blöcke&#xD;ca:blocs del codi textual _&#xD;</translations><inputs><input type="%code" initial="1">(+ 3 4)</input></inputs><script><block s="doReport"><block s="reportJoinWords"><block s="reportTextSplit"><block var="code"/><l><option>blocks</option></l></block></block></block></script></block-definition><block-definition s="encode blocks %&apos;script&apos; to text %&apos;lines&apos; pretty" type="reporter" category="operators"><comment x="0" y="0" w="106" collapsed="false">turn blocks into LISP syntax text code.</comment><header></header><code></code><translations>de:verwandle Blöcke _ in Code _ formatiert&#xD;ca:codi textual dels blocs _ formatats _&#xD;</translations><inputs><input type="%repRing" initial="1"></input><input type="%b" initial="1">true</input></inputs><script><block s="doReport"><block s="evaluate"><block s="reifyReporter"><autolambda><block s="reportListAttribute"><l></l><block s="reportTextSplit"><block var="script"/><l><option>blocks</option></l></block></block></autolambda><list></list></block><list><block s="reportIfElse"><block var="lines"/><l>lines</l><l>text</l></block></list></block></block></script></block-definition><block-definition s="object %&apos;fields&apos;" type="reporter" category="lists"><header></header><code></code><translations>de:Objekt _&#xD;</translations><inputs><input type="%group%t%s" irreplaceable="true" expand="$nl&#xD;:" initial="2" min="2">$_field&#xD;$_thing</input></inputs><script><block s="doDeclareVariables"><list><l>data</l></list></block><block s="doSetVar"><l>data</l><block s="reportNewList"><list></list></block></block><block s="doWarp"><script><block s="doForEach"><l>assoc</l><block var="fields"/><script><block s="doReplaceInList"><block s="reportListItem"><l>1</l><block var="assoc"/></block><block var="data"/><block s="reportListItem"><l>2</l><block var="assoc"/></block></block><block s="doTellTo"><block s="reportEnvironment"><l><option>caller</option></l></block><block s="reifyScript"><script><block s="doSetVar"><l></l><l></l></block></script><list></list></block><list><block s="reportListItem"><l>1</l><block var="assoc"/></block><block s="reportListItem"><block s="reportListItem"><l>1</l><block var="assoc"/></block><block var="data"/></block></list></block></script></block></script></block><block s="doReport"><block var="data"/></block></script></block-definition><block-definition s="clone %&apos;parent&apos; %&apos;fields&apos;" type="reporter" category="lists"><header></header><code></code><translations>de:klone _ _&#xD;</translations><inputs><input type="%l" initial="1"></input><input type="%group%upvar%s" irreplaceable="true" expand="$nl&#xD;:">$_field&#xD;$_thing</input></inputs><script><block s="doDeclareVariables"><list><l>data</l></list></block><block s="doSetVar"><l>data</l><custom-block s="object %group%t%s"><list><l>...</l><block var="parent"/></list></custom-block></block><block s="doIf"><block s="reportNot"><block s="reportListIsEmpty"><block var="fields"/></block></block><script><block s="doWarp"><script><block s="doForEach"><l>assoc</l><block var="fields"/><script><block s="doReplaceInList"><block s="reportListItem"><l>1</l><block var="assoc"/></block><block var="data"/><block s="reportListItem"><l>2</l><block var="assoc"/></block></block><block s="doTellTo"><block s="reportEnvironment"><l><option>caller</option></l></block><block s="reifyScript"><script><block s="doSetVar"><l></l><l></l></block></script><list></list></block><list><block s="reportListItem"><l>1</l><block var="assoc"/></block><block s="reportListItem"><block s="reportListItem"><l>1</l><block var="assoc"/></block><block var="data"/></block></list></block></script></block></script></block></script><list></list></block><block s="doReport"><block var="data"/></block></script></block-definition><block-definition s="field %&apos;field&apos; of %&apos;object&apos; %&apos;inputs&apos;" type="reporter" category="lists" space="true"><header></header><code></code><translations>de:Feld _ von _ _&#xD;</translations><inputs><input type="%anyUE" initial="1"><options>§_dynamicMenu</options></input><input type="%l" initial="1"></input><input type="%mult%s" expand="$_with inputs"></input></inputs><script><block s="doDeclareVariables"><list><l>syntax</l><l>value</l></list></block><block s="doSetVar"><l>syntax</l><block s="reportTextSplit"><block var="field"/><l><option>blocks</option></l></block></block><block s="doSetVar"><l>value</l><block s="reportListItem"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><block var="syntax"/></block><block s="reifyReporter"><autolambda><block var=" "/></autolambda><list></list></block></list></block><block s="reportListItem"><l>2</l><block var="syntax"/></block><block s="evaluate"><block var="field"/><list></list></block></block><block var="object"/></block></block><block s="doIf"><block s="reportIsA"><block var="value"/><l><option>script</option></l></block><script><block s="doSetVar"><l>syntax</l><block s="reportListAttribute"><l><option>flatten</option></l><block s="reportTextSplit"><block var="value"/><l><option>blocks</option></l></block></block></block><block s="doIf"><block s="reportVariadicOr"><list><block s="reportNot"><block s="reportIsA"><block s="reportListItem"><l>1</l><block var="syntax"/></block><l><option>command</option></l></block></block><block s="reportListContainsItem"><block var="syntax"/><block s="reifyScript"><script><block s="doReport"><l></l></block></script><list></list></block></block></list></block><script><block s="doReport"><block s="evaluate"><block var="value"/><block var="inputs"/></block></block></script><list></list></block><block s="doRun"><block var="value"/><block var="inputs"/></block><block s="doReport"><l></l></block></script><list></list></block><block s="doReport"><block var="value"/></block></script><scripts><script x="10" y="467.49999999999994"><block s="receiveSlotEvent"><l>field</l><l><option>menu</option></l></block><block s="doReport"><block s="reportListAttribute"><l><option>sorted</option></l><block s="reportListAttribute"><l><option>uniques</option></l><block s="evaluate"><block s="reifyReporter"><autolambda><block s="reportConcatenatedLists"><list><block s="reportListItem"><l>1</l><block s="reportListAttribute"><l><option>columns</option></l><l/></block></block><block s="reportIfElse"><block s="reportIsA"><block s="reportListItem"><l><option>parent</option></l><l/></block><l><option>list</option></l></block><block s="evaluate"><block s="reportEnvironment"><l><option>script</option></l></block><list><block s="reportListItem"><l><option>parent</option></l><l/></block></list></block><block s="reportNewList"><list></list></block></block></list></block></autolambda><list></list></block><list><block var="object"/></list></block></block></block></block></script><script x="10" y="709.8333333333335"><block s="receiveSlotEvent"><l>field</l><l><option>edited</option></l></block><block s="doDeclareVariables"><list><l>value</l></list></block><block s="doSetVar"><l>value</l><block s="reportListItem"><block s="evaluate"><block var="field"/><list></list></block><block var="object"/></block></block><block s="doSetSlot"><l>inputs</l><block s="reportReshape"><block var="inputs"/><list><block s="reportIfElse"><block s="reportIsA"><block var="value"/><l><option>script</option></l></block><block s="evaluate"><block s="reifyReporter"><autolambda><block s="reportDifference"><block s="reportListAttribute"><l><option>length</option></l><l/></block><block s="reportListAttribute"><l><option>length</option></l><block s="reportTextSplit"><block s="reportListItem"><l>1</l><l/></block><l><option>blocks</option></l></block></block></block></autolambda><list></list></block><list><block s="evaluate"><block s="reifyReporter"><autolambda><block s="reportIfElse"><block s="reportIsA"><block s="reportListItem"><l>1</l><l/></block><l><option>list</option></l></block><block s="reportListItem"><l>1</l><l/></block><l></l></block></autolambda><list></list></block><list><block s="reportTextSplit"><block var="value"/><l><option>blocks</option></l></block></list></block></list></block><l>0</l></block></list></block></block></script></scripts></block-definition><block-definition s="add %&apos;fields&apos; to %&apos;data&apos;" type="command" category="lists"><header></header><code></code><translations>de:füge _ zu _ hinzu&#xD;</translations><inputs><input type="%group%upvar%s" irreplaceable="true" expand="$nl&#xD;:" initial="2" min="2">$_field&#xD;$_thing</input><input type="%l" initial="1"></input></inputs><script><block s="doWarp"><script><block s="doForEach"><l>assoc</l><block var="fields"/><script><block s="doReplaceInList"><block s="reportListItem"><l>1</l><block var="assoc"/></block><block var="data"/><block s="reportListItem"><l>2</l><block var="assoc"/></block></block><block s="doTellTo"><block s="reportEnvironment"><l><option>caller</option></l></block><block s="reifyScript"><script><block s="doSetVar"><l></l><l></l></block></script><list></list></block><list><block s="reportListItem"><l>1</l><block var="assoc"/></block><block s="reportListItem"><block s="reportListItem"><l>1</l><block var="assoc"/></block><block var="data"/></block></list></block></script></block></script></block></script></block-definition><block-definition s="when variable %&apos;variable&apos; changes" type="hat" category="variables"><variables><list struct="atomic" id="10024">old</list></variables><header></header><code></code><translations>de:Wenn Variable _ sich ändert&#xD;</translations><inputs><input type="%s" readonly="true" irreplaceable="true" initial="1"><options>§_getVarNamesDict</options></input></inputs><script><block s="doIf"><block s="reportVariadicOr"><list><block s="reportNot"><block s="reportListContainsItem"><block s="reportAttributeOf"><l><option>variables</option></l><block s="reportEnvironment"><l><option>caller</option></l></block></block><block var="variable"/></block></block><block s="reportVariadicEquals"><list><block s="reportAttributeOf"><block var="variable"/><block s="reportEnvironment"><l><option>caller</option></l></block></block><block var="old"/></list></block></list></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doSetVar"><l>old</l><block s="reportAttributeOf"><block var="variable"/><block s="reportEnvironment"><l><option>caller</option></l></block></block></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script></block-definition><block-definition s="when %&apos;sensor&apos; &gt; %&apos;threshold&apos;" type="hat" category="sensing"><header></header><code></code><translations>de:Wenn _ &gt; _&#xD;</translations><inputs><input type="%s" readonly="true" irreplaceable="true" initial="1">$_volume<options>volume=$_volume&#xD;timer=$_timer</options></input><input type="%n" initial="1">5</input></inputs><script><block s="doReport"><block s="reportVariadicGreaterThan"><list><block s="evaluate"><block s="reportListItem"><block s="reportApplyExtension"><l>txt_transform(name, txt)</l><list><l>unselect</l><block var="sensor"/></list></block><block s="reportNewList"><list><block s="reportNewList"><list><l>volume</l><block s="reifyReporter"><autolambda><block s="reportAudio"><l><option>volume</option></l></block></autolambda><list></list></block></list></block><block s="reportNewList"><list><l>timer</l><block s="reifyReporter"><autolambda><block s="getTimer"></block></autolambda><list></list></block></list></block></list></block></block><list></list></block><block var="threshold"/></list></block></block></script></block-definition><block-definition s="when background switches to %&apos;costume name&apos;" type="hat" category="looks"><header></header><code></code><translations>de:Wenn Hintergrund zu _ wechselt&#xD;</translations><inputs><input type="%s" readonly="true" irreplaceable="true" initial="1"><options>§_dynamicMenu</options></input></inputs><script><block s="doReport"><block s="reportVariadicEquals"><list><block s="reportAttributeOf"><l><option>costume name</option></l><block s="reportGet"><l><option>stage</option></l></block></block><block var="costume name"/></list></block></block></script><scripts><script x="10" y="121.83333333333331"><block s="receiveSlotEvent"><l>costume name</l><l><option>menu</option></l></block><block s="doReport"><block s="reportGetImageAttribute"><l><option>name</option></l><block s="reportAskFor"><block s="reportGet"><l><option>stage</option></l></block><block s="reifyReporter"><autolambda><block s="reportGet"><l><option>costumes</option></l></block></autolambda><list></list></block><list></list></block></block></block></script></scripts></block-definition><block-definition s="has %&apos;test&apos; happened?" type="predicate" category="operators"><variables><list struct="atomic" id="10160">last state</list></variables><header></header><code></code><translations>de:hat _ sich ereignet?&#xD;</translations><inputs><input type="%b" initial="1"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="test"/><block var="last state"/></list></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doSetVar"><l>last state</l><block var="test"/></block><block s="doReport"><block var="test"/></block></script></block-definition><block-definition s="has %&apos;value&apos; changed?" type="predicate" category="variables"><variables><list struct="atomic" id="10183">old</list></variables><header></header><code></code><translations>de:hat _ sich verändert?&#xD;</translations><inputs><input type="%s" initial="1"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="value"/><block var="old"/></list></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doSetVar"><l>old</l><block var="value"/></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script></block-definition><block-definition s="when %&apos;value&apos; changes" type="hat" category="control"><variables><list struct="atomic" id="10208">old</list></variables><header></header><code></code><translations>de:Wenn _ sich ändert&#xD;</translations><inputs><input type="%s" initial="1"></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="value"/><block var="old"/></list></block><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script><list></list></block><block s="doSetVar"><l>old</l><block var="value"/></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script></block-definition><block-definition s="bitwise not %&apos;a&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_not(a)</l><list><block var="a"/></list></block></block></script></block-definition><block-definition s="bitwise %&apos;a&apos; and %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_and(a, b)</l><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="bitwise %&apos;a&apos; or %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_or(a, b)</l><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="bitwise %&apos;a&apos; xor %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_xor(a, b)</l><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="bitwise left shift %&apos;a&apos; by %&apos;b&apos; bits" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_left_shift(a, b)</l><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="bitwise right shift %&apos;a&apos; by %&apos;b&apos; bits" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_right_shift(a, b)</l><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="bitwise unsigned right shift %&apos;a&apos; by %&apos;b&apos; bits" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>bit_unsigned_right_shift(a, b)</l><list><block var="a"/><block var="b"/></list></block></block></script></block-definition><block-definition s="tilt %&apos;axis&apos;" type="reporter" category="sensing"><header></header><code></code><translations>de:Neigung _&#xD;ar:_ الميل ض&#xD;ca:inclinació _&#xD;cs:náklon _&#xD;el:κλίση _&#xD;es:inclinación _&#xD;fr:inclinaison _&#xD;gl:inclinación _&#xD;ja:_ 仰角&#xD;nl:kantel _&#xD;pl:nachylenie _&#xD;pt_BR:inclinação _&#xD;pt:inclinação _&#xD;ru:наклон _&#xD;ta:சாய் _&#xD;tr:eğilim _&#xD;zh_CN:倾角 _&#xD;zh_TW:倾角 _&#xD;</translations><inputs><input type="%s" readonly="true" initial="1">x<options>x&#xD;y&#xD;z&#xD;&#126;&#xD;xyz</options></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>ori_tilt(xyz)</l><list><block var="axis"/></list></block></block></script></block-definition><block-definition s="Y %&apos;x&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%repRing" initial="1"></input></inputs><script><block s="doReport"><block s="evaluate"><block var="x"/><list><block var="x"/></list></block></block></script></block-definition><block-definition s="get %&apos;var&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%s" initial="1"></input></inputs><script><custom-block s="create %s var %mult%txt"><l>script</l><list><block var="var"/></list></custom-block><block s="doReport"><custom-block s="var %s"><block var="var"/></custom-block></block></script></block-definition></blocks><primitives></primitives><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="true" penlog="true" volume="100" pan="0" lines="flat" ternary="false" hyperops="true" codify="true" inheritance="true" sublistIDs="false" id="10331"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAAAXNSR0IArs4c6QAADoVJREFUeF7t1cEJAAAIxDDdf2m3sJ+4wEEQuuMIECBAgACBd4F9XzRIgAABAgQIjAB7AgIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECByxcQFpoRMBzwAAAABJRU5ErkJggg==</pentrails><costumes><list struct="atomic" id="10332"></list></costumes><sounds><list struct="atomic" id="10333"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="10338"><costumes><list struct="atomic" id="10339"></list></costumes><sounds><list struct="atomic" id="10340"></list></sounds><blocks></blocks><variables></variables><scripts><script x="166.7822265625" y="10"><block s="receiveGo"></block><block s="doSetVar"><l>zero</l><l>0</l></block><block s="doSetVar"><l>one</l><l>1</l></block><block s="doSetVar"><l>al</l><l>0</l></block><block s="doSetVar"><l>bl</l><l>0</l></block><block s="doSetVar"><l>cl</l><l>0</l></block><block s="doSetVar"><l>dl</l><l>0</l></block></script></scripts></sprite><watcher var="al" style="normal" x="10" y="10" color="243,118,29"/><watcher var="bl" style="normal" x="10" y="31.000001999999995" color="243,118,29"/><watcher var="cl" style="normal" x="10" y="52.00000399999999" color="243,118,29"/><watcher var="dl" style="normal" x="10" y="73.00000599999998" color="243,118,29"/><watcher var="zero" style="normal" x="10" y="94.00000799999998" color="243,118,29" hidden="true"/><watcher var="one" style="normal" x="10" y="115.00000999999997" color="243,118,29" hidden="true"/></sprites></stage><variables><variable name="al"><l>2</l></variable><variable name="bl"><l>0</l></variable><variable name="cl"><l>0</l></variable><variable name="dl"><l>0</l></variable><variable name="THE EMPTY STREAM"><list struct="atomic" id="10370">*the empty stream*</list></variable><variable name="zero"><l>0</l></variable><variable name="one"><l>0</l></variable></variables></scene></scenes></project><media name="Assembly" app="Snap! 10.7.1, https://snap.berkeley.edu" version="2"></media></snapdata>