<blocksapp="Snap! 4.0, http://snap.berkeley.edu"version="1"><block-definitions="%'head' in front of stream %'tail'"type="reporter"category="lists"><header></header><code></code><inputs><inputtype="%s"></input><inputtype="%anyUE"></input></inputs><script><blocks="doReport"><blocks="reportNewList"><list><blockvar="head"/><blockvar="tail"/><blocks="reportFalse"></block><blocks="reportFalse"></block></list></block></block></script></block-definition><block-definitions="head of stream %'stream'"type="reporter"category="lists"><header></header><code></code><inputs><inputtype="%l"></input></inputs><script><blocks="doReport"><blocks="reportListItem"><l>1</l><blockvar="stream"/></block></block></script></block-definition><block-definitions="tail of stream %'stream'"type="reporter"category="lists"><header></header><code></code><inputs><inputtype="%l"></input></inputs><script><blocks="doWarp"><script><blocks="doIf"><blocks="reportListItem"><l>3</l><blockvar="stream"/></block><script><blocks="doReport"><blocks="reportListItem"><l>4</l><blockvar="stream"/></block></block></script></block><blocks="doReplaceInList"><l>4</l><blockvar="stream"/><blocks="evaluate"><blocks="reportListItem"><l>2</l><blockvar="stream"/></block><list></list></block></block><blocks="doReplaceInList"><l>3</l><blockvar="stream"/><blocks="reportTrue"></block></block><blocks="doReport"><blocks="reportListItem"><l>4</l><blockvar="stream"/></block></block></script></block></script></block-definition><block-definitions="map %'function' over stream %'stream'"type="reporter"category="lists"><header></header><code></code><inputs><inputtype="%repRing"></input><inputtype="%mult%l"></input></inputs><script><blocks="doWarp"><script><blocks="doIf"><blocks="reportEquals"><blocks="reportListItem"><l>1</l><blockvar="stream"/></block><blocks="reportNewList"><list></list></block></block><script><blocks="doReport"><blocks="reportNewList"><list></list></block></block></script></block><blocks="doReport"><custom-blocks="%s in front of stream %anyUE"><blocks="evaluate"><blockvar="function"/><custom-blocks="map %repRing over %mult%l"><blocks="reifyReporter"><autolambda><custom-blocks="head of stream %l"><l/></custom-block></autolambda><list></list></block><list><blockvar="stream"/></list></custom-block></block><custom-blocks="map %repRing over stream %mult%l"><blockvar="function"/><custom-blocks="map %repRing over %mult%l"><blocks="reifyReporter"><autolambda><custom-blocks="tail of stream %l"><l/></custom-block></autolambda><list></list></block><list><blockvar="stream"/></list></custom-block></custom-block></custom-block></block></script></block></script></block-definition><block-definitions="keep items such that %'pred' from stream %'stream'"type="reporter"category="lists"><header></header><code></code><inputs><inputtype="%predRing"></input><inputtype="%l"></input></inputs><script><blocks="doWarp"><script><blocks="doIf"><blocks="reportEquals"><blockvar="stream"/><blocks="reportNewList"><list></list></block></block><script><blocks="doReport"><blocks="reportNewList"><list></list></block></block></script></block><blocks="doIfElse"><blocks="evaluate"><blockvar="pred"/><list><custom-blocks="head of stream %l"><blockvar="stream"/></custom-block></list></block><script><blocks="doReport"><custom-blocks="%s in front of stream %anyUE"><custom-blocks="head of stream %l"><blockvar="stream"/></custom-block><custom-blocks="keep items such that %predRing from stream %l"><blockvar="pred"/><custom-blocks="tail of stream %l"><blockvar="stream"/></custom-block></custom-block></custom-block></block></script><script><blocks="doReport"><custom-blocks="keep items such that %predRing from stream %l"><blockvar="pred"/><custom-blocks="tail of stream %l"><blockvar="stream"/></custom-block></custom-block></block></script></block></script></block></script></block-definition><block-definitions="map%'function'over%'list