turtlestitch/libraries/stream-tools.xml

1 wiersz
16 KiB
XML

2020-07-26 04:46:48 +00:00
<blocks app="Snap! 6, https://snap.berkeley.edu" version="1"><block-definition s="%&apos;head&apos; in front of stream %&apos;tail&apos;" type="reporter" category="lists"><comment w="418.6106770833333" collapsed="false">The stream version of IN FRONT OF.&#xD;&#xD;Streams, also called lazy lists, are like lists except that&#xD;items are not computed until they&apos;re needed. This allows&#xD;for more efficient handling of large computed lists, and&#xD;even infinite lists. The only piece of magic is here in &#xD;IN FRONT OF STREAM, whose second input is of type &#xD;Unevaluated, which means that it&apos;s a procedure, with &#xD;a sort of invisible gray ring. So HEAD OF STREAM is just &#xD;ITEM 1 OF, but TAIL OF STREAM has a CALL block &#xD;to make the computation happen.&#xD;&#xD;For a tutorial introduction to streams, read SICP 3.5:&#xD;https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-24.html#%_sec_3.5&#xD;or Brian&apos;s lecture notes (start on page 74):&#xD;https://people.eecs.berkeley.edu/&#126;bh/61a-pages/Volume2/notes.pdf&#xD;The above are clickable links!</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="tail"/><block s="reportBoolean"><l><bool>false</bool></l></block><block s="reportBoolean"><l><bool>false</bool></l></block></list></block></block></script></block-definition><block-definition s="head of stream %&apos;stream&apos;" type="reporter" category="lists"><comment w="418.6106770833333" collapsed="false">The stream version of ITEM 1 OF.&#xD;&#xD;Streams, also called lazy lists, are like lists except that&#xD;items are not computed until they&apos;re needed. This allows&#xD;for more efficient handling of large computed lists, and&#xD;even infinite lists. The only piece of magic is in &#xD;IN FRONT OF STREAM, whose second input is of type &#xD;Unevaluated, which means that it&apos;s a procedure, with &#xD;a sort of invisible gray ring. So HEAD OF STREAM is just &#xD;ITEM 1 OF, but TAIL OF STREAM has a CALL block &#xD;to make the computation happen.&#xD;&#xD;For a tutorial introduction to streams, read SICP 3.5:&#xD;https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-24.html#%_sec_3.5&#xD;or Brian&apos;s lecture notes (start on page 74):&#xD;https://people.eecs.berkeley.edu/&#126;bh/61a-pages/Volume2/notes.pdf&#xD;The above are clickable links!</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></block-definition><block-definition s="tail of stream %&apos;stream&apos;" type="reporter" category="lists"><comment w="418.6106770833333" collapsed="false">The stream version of ALL BUT FIRST OF.&#xD;&#xD;Streams, also called lazy lists, are like lists except that&#xD;items are not computed until they&apos;re needed. This allows&#xD;for more efficient handling of large computed lists, and&#xD;even infinite lists. The only piece of magic is in &#xD;IN FRONT OF STREAM, whose second input is of type &#xD;Unevaluated, which means that it&apos;s a procedure, with &#xD;a sort of invisible gray ring. So HEAD OF STREAM is just &#xD;ITEM 1 OF, but TAIL OF STREAM has a CALL block &#xD;to make the computation happen.&#xD;&#xD;For a tutorial introduction to streams, read SICP 3.5:&#xD;https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-24.html#%_sec_3.5&#xD;or Brian&apos;s lecture notes (start on page 74):&#xD;https://people.eecs.berkeley.edu/&#126;bh/61a-pages/Volume2/notes.pdf&#xD;The above are clickable links!</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="doWarp"><script><block s="doIf"><block s="reportList