<snapdata remixID="9374119"><project name="objects" app="Snap! 7, https://snap.berkeley.edu" version="2"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAAAu5JREFUeF7t1SFOY1EAhtFbamEHVRSHYQEoVJMaRE3DFtgCeyBBsRsSLNvAoVFASSrGzJRR5RM9tX25f953T/Imm81mM/wUiApMAIzKm90WABCEtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DuMPA19fXODo6ImTPBQDcEfjh4WE8Pz+P5XI5ZrPZuLq6GpPJZM/XcXjHA/jDnd/e3o7X19ftE+/v7+Pi4mLM5/MtxrOzs8PTsoc3BvA/UVer1fj8/Pzrqbe3t7FYLMb19fU4Pz/fw9UcxpEA/nDPT09P4/7+/s+n9+PjY5ycnGzhnZ6ejsvLy8NQsse3BHBH3JeXl3F3d7f99+bmZkyn07Fer/d4FYd5NIA77v3x8XEL7/j4+DBl/NJbA/hLoc38uwCAZKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNA8hAWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAGCa3ziADKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNA8hAWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAGCa3ziADKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNA8hAWgDANL9xABlICwCY5jcOIANpAQDT/MYBZCAtAGCa3ziADKQFAEzzGweQgbQAgGl+4wAykBYAMM1vHEAG0gIApvmNfwN5cAu33UceWwAAAABJRU5ErkJggg==</thumbnail><scenes select="1"><scene name="objects"><notes></notes><hidden></hidden><headers></headers><code><string>&lt;#1&gt;</string><delim></delim></code><blocks><block-definition s="run function ( %&apos;params&apos; ) { %&apos;body&apos; } with %&apos;inputs&apos;" type="command" category="control"><header></header><code></code><translations>es:ejecutar función ( _ ) { _ } con _&#xD;</translations><inputs><input type="%mult%s"></input><input type="%code"></input><input type="%mult%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><block var="params"/><block var="body"/></block><block var="inputs"/></block></script></block-definition><block-definition s="call function ( %&apos;params&apos; ) { %&apos;body&apos; } with %&apos;inputs&apos;" type="reporter" category="control"><header></header><code></code><translations>es:llamar función ( _ ) { _ } con _&#xD;</translations><inputs><input type="%mult%s"></input><input type="%code">return 0;</input><input type="%mult%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><block var="params"/><block var="body"/></block><block var="inputs"/></block></block></script></block-definition><block-definition s="switch to dev mode" type="command" category="other"><header></header><code></code><translations>es:cambiar a modo des&#xD;</translations><inputs></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>ide</l></list><l>ide.switchToDevMode();</l><list><custom-block s="ide"></custom-block></list></custom-block></script></block-definition><block-definition s="switch to user mode" type="command" category="other"><header></header><code></code><translations>es:cambiar a modo usuario&#xD;</translations><inputs></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>ide</l></list><l>ide.switchToUserMode();</l><list><custom-block s="ide"></custom-block></list></custom-block></script></block-definition><block-definition s="ide" type="reporter" category="sensing"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>return this.parentThatIsA(IDE_Morph);</l><list><l></l></list></custom-block></block></script></block-definition><block-definition s="in dev mode?" type="predicate" category="other"><header></header><code></code><translations>es:¿en modo des?&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>world</l></list><l>return world.isDevMode;</l><list><custom-block s="world"></custom-block></list></custom-block></block></script></block-definition><block-definition s="inspect %&apos;obj&apos;" type="command" category="other"><header></header><code></code><translations>es:inspeccionar _&#xD;</translations><inputs><input type="%obj"></input></inputs><script><block s="doIf"><block s="reportNot"><custom-block s="in dev mode?"></custom-block></block><script><custom-block s="switch to dev mode"></custom-block></script></block><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list></list><l>this.inspect(obj);</l><list></list></custom-block></script></block-definition><block-definition s="save project" type="command" category="other"><header></header><code></code><translations>es:guadar projeto&#xD;</translations><inputs></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>ide</l></list><l>ide.save();</l><list><custom-block s="ide"></custom-block></list></custom-block></script></block-definition><block-definition s="world" type="reporter" category="sensing"><header></header><code></code><translations>es:mundo&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>ide</l></list><l>return ide.world();</l><list><custom-block s="ide"></custom-block></list></custom-block></block></script></block-definition><block-definition s="this process" type="reporter" category="sensing"><header></header><code></code><translations>es:este proceso&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>proc</l></list><l>proc.toString = function() {return "a SnapProcess";};&#xD;return proc;</l><list></list></custom-block></block></script></block-definition><block-definition s="this script is clicked?" type="predicate" category="control"><header></header><code></code><translations>es:¿esta secuencia tiene clic?&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>proc</l></list><l>return proc.isClicked;</l><list><custom-block s="this process"></custom-block></list></custom-block></block></script></block-definition><block-definition s="warped?" type="predicate" category="control"><header></header><code></code><translations>es:¿atómica?&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>proc</l></list><l>return proc.isAtomic;</l><list><custom-block s="this process"></custom-block></list></custom-block></block></script></block-definition><block-definition s="%&apos;thing&apos; assert type(s) %&apos;typeString&apos;" type="command" category="operators"><comment x="0" y="0" w="306" collapsed="false">make sure &quot;thing&quot; is a particular type or any of a number of types&#xD;and raise an error if not&#xD;use responsibly wrt performance implications</comment><header></header><code></code><translations>es:_ aseverar tipo(s) _&#xD;</translations><inputs><input type="%s"></input><input type="%mult%txt"></input></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>proc</l><l>thing</l><l>typeString</l></list><l>proc.assertType(thing, typeString.asArray());</l><list><custom-block s="this process"></custom-block><block var="thing"/><block var="typeString"/></list></custom-block></script></block-definition><block-definition s="WiP: create/recolor category %&apos;name&apos; color %&apos;r&apos; %&apos;g&apos; %&apos;b&apos;" type="command" category="other"><comment x="0" y="0" w="201" collapsed="false">Blocks in custom categories are saved in their categories, but the categories themselves are not; running create category with the same name gets the block back in the palette, but it seems that blocks in the editor are obsolete.</comment><header></header><code></code><translations>es:TeP: crear/recolorear categoría _ color _ _ _&#xD;</translations><inputs><input type="%txt"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>SpMoPr</l><l>name</l><l>r</l><l>g</l><l>b</l><l>ide</l></list><l>if(name != "") {&#xD;const cats = SpMoPr.categories;&#xD;if(!cats.includes(name)) {cats.push(name);};&#xD;SpMoPr.blockColor[name] = new Color(r, g, b, 1);&#xD;ide.createCategories();&#xD;ide.reactToWorldResize(world.bounds.copy());&#xD;ide.flushBlocksCache();&#xD;ide.refreshPalette();&#xD;}</l><list><custom-block s="SpriteMorph.prototype"></custom-block><block var="name"/><block var="r"/><block var="g"/><block var="b"/><custom-block s="ide"></custom-block></list></custom-block></script></block-definition><block-definition s="%&apos;property&apos; of %&apos;object&apos;" type="reporter" category="operators"><header></header><code></code><translations>es:_ de _&#xD;</translations><inputs><input type="%s"></input><input type="%obj"></input></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>property</l><l>object</l></list><l>return object[property];</l><list><block var="property"/><block var="object"/></list></custom-block></block></script></block-definition><block-definition s="SpriteMorph.prototype" type="reporter" category="sensing"><header></header><code></code><translations>es:SpriteMorph.prototipo&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list></list><l>return SpriteMorph.prototype;</l><list></list></custom-block></block></script></block-definition><block-definition s="hello" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs></block-definition><block-definition s="that obsolete block should be this" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs></block-definition><block-definition s="test" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs></block-definition><block-definition s="testest %&apos;theInvisibleZebra&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%cs"></input></inputs></block-definition><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="other"><header></header><code></code><translations>es:intentar de forma segura _ luego si _ _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doDeclareVariables"><list><l>reset</l></list></block><block s="doSetVar"><l>reset</l><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>var oldHandleError = proc.handleError,&#xD;    oldCatchingErrors = proc.isCatchingErrors;&#xD;&#xD;return function(){&#xD; proc.handleError = oldHandleError;&#xD; proc.isCatchingErrors = oldCatchingErrors;&#xD;}</l><list><l></l></list></custom-block></block><block s="doCallCC"><block s="reifyScript"><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>proc.isCatchingErrors = true;&#xD;proc.handleError = function(error, element){&#xD; reset();&#xD; proc.context = handler;&#xD; proc.context.variables.setVar("error", error);&#xD;}&#xD;&#xD;try{&#xD; proc.evaluate(action, new List(), true);&#xD;}&#xD;catch(e){&#xD; proc.handleError(e, null);&#xD;}</l><list><l></l></list></custom-block></script><list><l>return</l></list></block></block></script></block-definition><block-definition s="error %&apos;msg&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>throw msg instanceof Error? msg : new Error(msg);</l><list><l></l></list></custom-block></script></block-definition><block-definition s="new Pinky Promise %&apos;cmnd&apos;" type="reporter" category="other"><header></header><code></code><translations>es:nuevo Promesa de Meñiques _&#xD;</translations><inputs><input type="%cmdRing"></input></inputs><script><block s="doDeclareVariables"><list><l>newProm</l><l>settle</l><l>fulfill</l><l>reject</l></list></block><block s="doSetVar"><l>newProm</l><block s="reportNewList"><list><l>Pinky Promise</l><l>pending</l></list></block></block><block s="doSetVar"><l>settle</l><block s="reportJSFunction"><list><l>newProm</l></list><l>newProm.becomeArray();&#xD;newProm.becomeLinked = () =&gt; {throw new Error("Settled Pinky Promises cannot become linked.");};&#xD;Object.freeze(newProm.contents);&#xD;Object.freeze(newProm);</l></block></block><block s="doSetVar"><l>fulfill</l><block s="reifyScript"><script><block s="doAddToList"><block var="value"/><block var="newProm"/></block><block s="doReplaceInList"><l>2</l><block var="newProm"/><l>fulfilled</l></block><block s="doRun"><block var="settle"/><list><block var="newProm"/></list></block></script><list><l>value</l></list></block></block><block s="doSetVar"><l>reject</l><block s="reifyScript"><script><block s="doAddToList"><block var="reason"/><block var="newProm"/></block><block s="doReplaceInList"><l>2</l><block var="newProm"/><l>rejected</l></block><block s="doRun"><block var="settle"/><list><block var="newProm"/></list></block></script><list><l>reason</l></list></block></block><block s="fork"><block s="reifyScript"><script><block s="errorObsolete"></block></script><list></list></block><list></list></block><block s="doReport"><block var="newProm"/></block></script><scripts><script x="448.9999999999998" y="495.19999999999897"><block s="doRun"><block var="reject"/><list><block var="error"/></list></block></script><script x="443.9999999999998" y="403.1999999999993"><block s="doRun"><block var="cmnd"/><list><block s="reifyScript"><script><block s="doRun"><block var="fulfill"/><list><l></l></list></block></script><list></list></block><block s="reifyScript"><script><block s="doRun"><block var="reject"/><list><l></l></list></block></script><list></list></block></list></block></script><comment x="484.6666666666665" y="307.3999999999988" w="165" collapsed="false">The obsolete block should be the safely try block that can be found in the Error Handling palette; the blocks below respectfully go in it</comment></scripts></block-definition><block-definition s="Battery Status API supported?" type="predicate" category="other"><header></header><code></code><translations>es:¿API de Estado de Batería compatible?&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list></list><l>if("getBattery" in navigator) {&#xD;if(!("batteryAPI" in this)){navigator.getBattery().then(b =&gt; {this.batteryAPI = b;});}&#xD;return true;} else {return false;}</l><list></list></custom-block></block></script></block-definition><block-definition s="charging?" type="predicate" category="other"><header></header><code></code><translations>es:¿cargando?&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportAnd"><block s="errorObsolete"></block><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>return this.batteryAPI.charging;</l><list><l></l></list></custom-block></block></block></script></block-definition><block-definition s="time until charged" type="reporter" category="other"><header></header><code></code><translations>es:tiempo hasta cargada&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportIfElse"><block s="errorObsolete"></block><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list></list><l>return this.batteryAPI.chargingTime;</l><list></list></custom-block><l>NaN</l></block></block></script></block-definition><block-definition s="time until dead" type="reporter" category="other"><header></header><code></code><translations>es:tiempo hasta muerta&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportIfElse"><block s="errorObsolete"></block><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list></list><l>return this.batteryAPI.dischargingTime;</l><list></list></custom-block><l>NaN</l></block></block></script></block-definition><block-definition s="level" type="reporter" category="other"><header></header><code></code><translations>es:nivel&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportIfElse"><block s="errorObsolete"></block><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list></list><l>return this.batteryAPI.level;</l><list></list></custom-block><l>NaN</l></block></block></script></block-definition><block-definition s="remove category %&apos;name&apos;" type="command" category="other"><header></header><code></code><translations>es:eliminar categoría _&#xD;</translations><inputs><input type="%txt"></input></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>name</l></list><l>const cats = SpMoPr.categories;&#xD;if(cats.includes(name)) {&#xD;cats.splice(cats.indexOf(name), 1);&#xD;ide.createCategories();&#xD;ide.reactToWorldResize(world.bounds.copy());&#xD;ide.flushBlocksCache();&#xD;ide.refreshPalette();&#xD;}</l><list><block var="name"/></list></custom-block></script></block-definition><block-definition s="generator function* ( %&apos;params&apos; ) { %&apos;body&apos; }" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%mult%s"></input><input type="%code"></input></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>const GeneratorFunction = (function*(){}).constructor;&#xD;return GeneratorFunction(...params.asArray(), body);</l><list><l></l></list></custom-block></block></script></block-definition><block-definition s="next generator %&apos;g&apos; with %&apos;v&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%obj"></input><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>return Object.defineProperty(g.next(v), "toString", function() {&#xD;return `done: ${this.done}&#xD;value: ${this.value}`;});</l><list><l></l></list></custom-block></block></script></block-definition><block-definition s="throw generator %&apos;g&apos; with %&apos;v&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%obj"></input><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>return Object.defineProperty(g.throw(v), "toString", function() {&#xD;return `done: ${this.done}&#xD;value: ${this.value}`;});</l><list><l></l></list></custom-block></block></script></block-definition><block-definition s="return generator %&apos;g&apos; with %&apos;v&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%obj"></input><input type="%s"></input></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l></l></list><l>return Object.defineProperty(g.return(v), "toString", function() {&#xD;return `done: ${this.done}&#xD;value: ${this.value}`;});</l><list><l></l></list></custom-block></block></script></block-definition><block-definition s="%&apos;list&apos; is linked?" type="predicate" category="lists"><header></header><code></code><translations>es:¿ _ está conectado?&#xD;</translations><inputs><input type="%l"></input></inputs><script><custom-block s="%s assert type(s) %mult%txt"><block var="list"/><list><l>list</l></list></custom-block><block s="doReport"><custom-block s="%s of %obj"><l>isLinked</l><block var="list"/></custom-block></block></script></block-definition><block-definition s="%&apos;list&apos; become array" type="command" category="lists"><header></header><code></code><translations>es:_ convertirse matriz&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="%l is linked?"><block var="list"/></custom-block><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>list</l></list><l>list.becomeArray();</l><list><block var="list"/></list></custom-block></script></block></script></block-definition><block-definition s="%&apos;list&apos; become linked" type="command" category="lists"><header></header><code></code><translations>es:_ convertirse conectado&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doIf"><block s="reportNot"><custom-block s="%l is linked?"><block var="list"/></custom-block></block><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>list</l></list><l>list.becomeLinked();</l><list><block var="list"/></list></custom-block></script></block></script></block-definition><block-definition s="set %&apos;property&apos; of %&apos;object&apos; to %&apos;value&apos;" type="command" category="operators"><header></header><code></code><translations>es:asignar _ de _ el valor _&#xD;</translations><inputs><input type="%s"></input><input type="%obj"></input><input type="%s"></input></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>property</l><l>object</l><l>value</l></list><l>object[property] = value;</l><list><block var="property"/><block var="object"/><block var="value"/></list></custom-block></script></block-definition><block-definition s="see %&apos;value&apos; %&apos;comment&apos;" type="reporter" category="other"><header></header><code></code><translations>es:ver _ _&#xD;</translations><inputs><input type="%s"></input><input type="%txt">Comment</input></inputs><script><custom-block s="run function ( %mult%s ) { %code } with %mult%s"><list><l>value</l><l>comment</l><l>SnapType</l></list><l>alert(`${value}&#xD;Snap! type: ${SnapType}&#xD;JavaScript type: ${typeof value}&#xD;${comment}`);</l><list><block var="value"/><block var="comment"/><block s="reportTypeOf"><block var="value"/></block></list></custom-block><block s="doReport"><block var="value"/></block></script></block-definition><block-definition s="%&apos;property&apos; is defined in %&apos;object&apos; ?" type="predicate" category="operators"><header></header><code></code><translations>es:¿ _ está definido en _ ?&#xD;</translations><inputs><input type="%s"></input><input type="%obj"></input></inputs><script><block s="doReport"><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>property</l><l>object</l></list><l>return object[property] !== undefined;</l><list><block var="property"/><block var="object"/></list></custom-block></block></script></block-definition><block-definition s="property-value pairs of %&apos;obj&apos;" type="reporter" category="operators"><header></header><code></code><translations>es:pares de propiedad-valor de _&#xD;</translations><inputs><input type="%obj"></input></inputs><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportIfElse"><custom-block s="%s is defined in %obj ?"><l></l><block var="obj"/></custom-block><block s="reportNewList"><list><l></l><custom-block s="%s of %obj"><l></l><block var="obj"/></custom-block></list></block><block s="reportNewList"><list><l></l></list></block></block></autolambda><list></list></block><custom-block s="call function ( %mult%s ) { %code } with %mult%s"><list><l>obj</l></list><l>return new List(Object.getOwnPropertyNames(obj));</l><list><block var="obj"/></list></custom-block></block></block></script></block-definition><block-definition s="username" type="reporter" category="sensing"><header></header><code></code><translations>es:nombre de usuario&#xD;</translations><inputs></inputs><script><block s="doReport"><custom-block s="%s of %obj"><l>username</l><custom-block s="%s of %obj"><l>cloud</l><custom-block s="ide"></custom-block></custom-block></custom-block></block></script></block-definition><block-definition s="found? %&apos;aaa&apos;" type="predicate" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportNot"><block s="reportListIsEmpty"><block var="aaa"/></block></block></block></script></block-definition><block-definition s="assoc %&apos;key&apos; %&apos;a-list&apos;" type="reporter" category="lists"><comment x="0" y="0" w="289.3333333333333" collapsed="false">The second input is an &quot;association list,&quot; a list of two-item lists.  Each of those smaller lists has a &quot;key&quot; as its first item and a &quot;value&quot; as its second.  ASSOC reports the first key-value pair in the association list whose key matches the first input.</comment><header></header><code></code><translations>ca:associació _ _&#xD;</translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="a-list"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doFor"><l>i</l><l>1</l><block s="reportListAttribute"><l><option>length</option></l><block var="a-list"/></block><script><block s="doIf"><block s="reportEquals"><block s="reportListItem"><l>1</l><block s="reportListItem"><block var="i"/><block var="a-list"/></block></block><block var="key"/></block><script><block s="doReport"><block s="reportListItem"><block var="i"/><block var="a-list"/></block></block></script></block></script></block><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block-definition><block-definition s="insert %&apos;name&apos; %&apos;value&apos; into %&apos;table&apos;" type="command" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>kv-pair</l></list></block><block s="doSetVar"><l>kv-pair</l><custom-block s="assoc %s %l"><block var="name"/><block var="table"/></custom-block></block><block s="doIfElse"><custom-block s="found? %l"><block var="kv-pair"/></custom-block><script><block s="doReplaceInList"><l>2</l><block var="kv-pair"/><block var="value"/></block></script><script><block s="doInsertInList"><block s="reportNewList"><list><block var="name"/><block var="value"/></list></block><l>1</l><block var="table"/></block></script></block></script></block-definition><block-definition s="%&apos;a&apos;" type="predicate" category="other"><header></header><code></code><translations></translations><inputs><input type="%mult%cs"></input></inputs><script><block s="doReport"><block var="a"/></block></script></block-definition><block-definition s="delete %&apos;key&apos; from %&apos;table&apos;" type="command" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doFor"><l>index</l><l>1</l><block s="reportListAttribute"><l><option>length</option></l><block var="table"/></block><script><block s="doIf"><block s="reportEquals"><block s="reportListItem"><l>1</l><block s="reportListItem"><block var="index"/><block var="table"/></block></block><block var="key"/></block><script><block s="doDeleteFromList"><block var="index"/><block var="table"/></block><block s="doStopThis"><l><option>this block</option></l></block></script></block></script></block></script></block-definition><block-definition s="clone of %&apos;parent&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%obj"></input></inputs><script><block s="doDeclareVariables"><list><l>self</l><l>methods</l><l>data</l></list></block><block s="doSetVar"><l>methods</l><block s="reportNewList"><list></list></block></block><block s="doSetVar"><l>data</l><block s="reportNewList"><list></list></block></block><custom-block s="insert %s %s into %l"><l>set</l><block s="reifyScript"><script><custom-block s="insert %s %s into %l"><block var="name"/><block var="value"/><block var="data"/></custom-block></script><list><l>self</l><l>name</l><l>value</l></list></block><block var="methods"/></custom-block><custom-block s="insert %s %s into %l"><l>method</l><block s="reifyScript"><script><custom-block s="insert %s %s into %l"><block var="name"/><block var="value"/><block var="methods"/></custom-block></script><list><l>self</l><l>name</l><l>value</l></list></block><block var="methods"/></custom-block><custom-block s="insert %s %s into %l"><l>clone</l><block s="reifyScript"><script><block s="doReport"><block s="errorObsolete"></block></block></script><list><l>self</l></list></block><block var="methods"/></custom-block><custom-block s="insert %s %s into %l"><l>delete var</l><block s="reifyScript"><script><custom-block s="delete %s from %l"><block var="name"/><block var="data"/></custom-block></script><list><l>self</l><l>name</l></list></block><block var="methods"/></custom-block><custom-block s="insert %s %s into %l"><l>delete method</l><block s="reifyScript"><script><custom-block s="delete %s from %l"><block var="name"/><block var="methods"/></custom-block></script><list><l>self</l><l>name</l></list></block><block var="methods"/></custom-block><custom-block s="insert %s %s into %l"><l>parent</l><block var="parent"/><block var="data"/></custom-block><block s="doSetVar"><l>self</l><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>kv-pair</l></list></block><block s="doSetVar"><l>kv-pair</l><custom-block s="assoc %s %l"><block var="message"/><block var="methods"/></custom-block></block><block s="doIf"><custom-block s="found? %l"><block var="kv-pair"/></custom-block><script><block s="doReport"><block s="reportListItem"><l>2</l><block var="kv-pair"/></block></block></script></block><block s="doSetVar"><l>kv-pair</l><custom-block s="assoc %s %l"><block var="message"/><block var="data"/></custom-block></block><block s="doIf"><custom-block s="found? %l"><block var="kv-pair"/></custom-block><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>2</l><block var="kv-pair"/></block></autolambda><list><l>self</l></list></block></block></script></block><block s="doIf"><block s="reportIsA"><block var="parent"/><l><option>command</option></l></block><script><block s="doReport"><block s="evaluate"><block var="parent"/><list><block var="message"/></list></block></block></script></block><block s="doReport"><block s="reportNewList"><list></list></block></block></script><list><l>message</l></list></block></block><block s="doReport"><block var="self"/></block></script></block-definition><block-definition s="new object" type="reporter" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><custom-block s="clone of %obj"><block s="reportNewList"><list></list></block></custom-block></block></script></block-definition><block-definition s="tell %&apos;object&apos; %&apos;message&apos; %&apos;args&apos;" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%s"></input><input type="%mult%s"></input></inputs><script><block s="doRun"><block s="evaluate"><block var="object"/><list><block var="message"/></list></block><block s="reportCONS"><block var="object"/><block var="args"/></block></block></script></block-definition><block-definition s="ask %&apos;object&apos; %&apos;message&apos; %&apos;args&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%s"></input><input type="%mult%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="evaluate"><block var="object"/><list><block var="message"/></list></block><block s="reportCONS"><block var="object"/><block var="args"/></block></block></block></script></block-definition><block-definition s="comment %&apos;obj&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs></block-definition><block-definition s=". %&apos;a&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%mult%cs"></input></inputs><script><block s="doReport"><block var="a"/></block></script></block-definition></blocks><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="true" inheritance="true" sublistIDs="false" id="974"><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="975"></list></costumes><sounds><list struct="atomic" id="976"></list></sounds><variables></variables><blocks></blocks><scripts><script x="20" y="20"><custom-block s="WiP: create/recolor category %txt color %n %n %n"><l>Error Handling</l><l>255</l><l>0</l><l>0</l></custom-block><custom-block s="WiP: create/recolor category %txt color %n %n %n"><l>Pinky Promises</l><l>255</l><l>175</l><l>175</l><comment w="80" collapsed="true">https://snap.berkeley.edu/snap/snap.html#present:Username=snapenilk&amp;ProjectName=Pinky%20Promises&amp;editMode&amp;noRun</comment></custom-block></script><script x="20" y="80"><custom-block s="WiP: create/recolor category %txt color %n %n %n"><l>Battery</l><l>200</l><l>100</l><l>50</l><comment w="80" collapsed="true">https://snap.berkeley.edu/snap/snap.html#present:Username=snapenilk&amp;ProjectName=%5BBattery%7D</comment></custom-block></script><script x="20" y="119"><custom-block s="WiP: create/recolor category %txt color %n %n %n"><l>Generators</l><l>175</l><l>200</l><l>0</l><comment w="80" collapsed="true">https://snap.berkeley.edu/snap/snap.html#present:Username=snapenilk&amp;ProjectName=f</comment></custom-block></script></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="0.13398765422198267" y="1.0155456397393152" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="1001"><costumes><list struct="atomic" id="1002"></list></costumes><sounds><list struct="atomic" id="1003"></list></sounds><blocks></blocks><variables></variables><scripts><comment x="147" y="116" w="266" collapsed="false">I ran into a problem: blocks of custom categories in the editor become obsolete after saving and reloading the project.</comment><script x="56" y="137"><block s="errorObsolete"></block></script><script x="124" y="21"><block s="receiveCondition"><block s="reportNot"><block s="errorObsolete"></block></block></block><custom-block s="WiP: create/recolor category %txt color %n %n %n"><l>obj</l><l>0</l><l>0</l><l>0</l></custom-block></script><script x="74.9951181875" y="190.800001"><block s="errorObsolete"></block></script><script x="56" y="311"><custom-block s="WiP: create/recolor category %txt color %n %n %n"><l>New Category</l><l>0</l><l>0</l><l>0</l></custom-block></script></scripts></sprite><watcher var="test" style="normal" x="10.7689062500001" y="10.76890625" color="243,118,29" hidden="true"/></sprites></stage><variables><variable name="test"><list id="1026"><item><list struct="atomic" id="1027">constructor,&quot;function JSCompiler(aProcess) {&#xD;	this.process = aProcess;&#xD;	this.source = null; // a context&#xD; 	this.gensyms = null; // temp dictionary for parameter substitutions&#xD;  	this.implicitParams = null;&#xD;   	this.paramCount = null;&#xD;}&quot;</list></item><item><list struct="atomic" id="1028">toString,&quot;function () {&#xD;    return &apos;a JSCompiler&apos;;&#xD;}&quot;</list></item><item><list struct="atomic" id="1029">compileFunction,&quot;function (aContext, implicitParamCount) {&#xD;    var block = aContext.expression,&#xD;  		parameters = aContext.inputs,&#xD;        parms = [],&#xD;        hasEmptySlots = false,&#xD;        myself = this,&#xD;        i;&#xD;&#xD;	this.source = aContext;&#xD;    this.implicitParams = implicitParamCount || 1;&#xD;&#xD;	// scan for empty input slots&#xD; 	hasEmptySlots = !isNil(detect(&#xD;  		block.allChildren(),&#xD;    	function (morph) {return morph.isEmptySlot &amp;&amp; morph.isEmptySlot(); }&#xD;    ));&#xD;&#xD;    // translate formal parameters into gensyms&#xD;    this.gensyms = {};&#xD;    this.paramCount = 0;&#xD;    if (parameters.length) {&#xD;        // test for conflicts&#xD;        if (hasEmptySlots) {&#xD;        	throw new Error(&#xD;                &apos;compiling does not yet support\n&apos; +&#xD;                &apos;mixing explicit formal parameters\n&apos; +&#xD;                &apos;with empty input slots&apos;&#xD;            );&#xD;        }&#xD;        // map explicit formal parameters&#xD;        parameters.forEach(function (pName, idx) {&#xD;        	var pn = &apos;p&apos; + idx;&#xD;            parms.push(pn);&#xD;        	myself.gensyms[pName] = pn;&#xD;        });&#xD;    } else if (hasEmptySlots) {&#xD;    	if (this.implicitParams &gt; 1) {&#xD;        	for (i = 0; i &lt; this.implicitParams; i += 1) {&#xD;         		parms.push(&apos;p&apos; + i);&#xD;         	}&#xD;     	} else {&#xD;        	// allow for a single implicit formal parameter&#xD;        	parms = [&apos;p0&apos;];&#xD;        }&#xD;    }&#xD;&#xD;    // compile using gensyms&#xD;&#xD;    if (block instanceof CommandBlockMorph) {&#xD;        return Function.apply(&#xD;            null,&#xD;            parms.concat([this.compileSequence(block)])&#xD;        );&#xD;    }&#xD;    return Function.apply(&#xD;        null,&#xD;        parms.concat([&apos;return &apos; + this.compileExpression(block)])&#xD;    );&#xD;}&quot;</list></item><item><list struct="atomic" id="1030">compileExpression,&quot;function (block) {&#xD;    var selector = block.selector,&#xD;        inputs = block.inputs(),&#xD;        target,&#xD;        rcvr,&#xD;        args;&#xD;&#xD;    // first check for special forms and infix operators&#xD;    switch (selector) {&#xD;    case &apos;reportOr&apos;:&#xD;        return this.compileInfix(&apos;||&apos;, inputs);&#xD;    case &apos;reportAnd&apos;:&#xD;        return this.compileInfix(&apos;&amp;&amp;&apos;, inputs);&#xD;    case &apos;reportIfElse&apos;:&#xD;        return &apos;(&apos; +&#xD;            this.compileInput(inputs[0]) +&#xD;            &apos; ? &apos; +&#xD;            this.compileInput(inputs[1]) +&#xD;            &apos; : &apos; +&#xD;            this.compileInput(inputs[2]) +&#xD;            &apos;)&apos;;&#xD;    case &apos;evaluateCustomBlock&apos;:&#xD;        throw new Error(&#xD;            &apos;compiling does not yet support\n&apos; +&#xD;            &apos;custom blocks&apos;&#xD;        );&#xD;&#xD;    // special command forms&#xD;    case &apos;doSetVar&apos;: // redirect var to process&#xD;        return &apos;arguments[arguments.length - 1].setVarNamed(&apos; +&#xD;            this.compileInput(inputs[0]) +&#xD;            &apos;,&apos; +&#xD;            this.compileInput(inputs[1]) +&#xD;            &apos;)&apos;;&#xD;    case &apos;doChangeVar&apos;: // redirect var to process&#xD;        return &apos;arguments[arguments.length - 1].incrementVarNamed(&apos; +&#xD;            this.compileInput(inputs[0]) +&#xD;            &apos;,&apos; +&#xD;            this.compileInput(inputs[1]) +&#xD;            &apos;)&apos;;&#xD;    case &apos;doReport&apos;:&#xD;        return &apos;return &apos; + this.compileInput(inputs[0]);&#xD;    case &apos;doIf&apos;:&#xD;        return &apos;if (&apos; +&#xD;            this.compileInput(inputs[0]) +&#xD;            &apos;) {\n&apos; +&#xD;            this.compileSequence(inputs[1].evaluate()) +&#xD;            &apos;}&apos;;&#xD;    case &apos;doIfElse&apos;:&#xD;        return &apos;if (&apos; +&#xD;            this.compileInput(inputs[0]) +&#xD;            &apos;) {\n&apos; +&#xD;            this.compileSequence(inputs[1].evaluate()) +&#xD;            &apos;} else {\n&apos; +&#xD;            this.compileSequence(inputs[2].evaluate()) +&#xD;            &apos;}&apos;;&#xD;&#xD;    default:&#xD;        target = this.process[selector] ? this.process&#xD;            : (this.source.receiver || this.process.receiver);&#xD;        rcvr = target.constructor.name + &apos;.prototype&apos;;&#xD;        args = this.compileInputs(inputs);&#xD;        if (isSnapObject(target)) {&#xD;            return rcvr + &apos;.&apos; + selector + &apos;.apply(&apos;+ rcvr + &apos;, [&apos; + args +&apos;])&apos;;&#xD;        } else {&#xD;            return &apos;arguments[arguments.length - 1].&apos; +&#xD;                selector +&#xD;                &apos;.apply(arguments[arguments.length - 1], [&apos; + args +&apos;])&apos;;&#xD;        }&#xD;    }&#xD;}&quot;</list></item><item><list struct="atomic" id="1031">compileSequence,&quot;function (commandBlock) {&#xD;    var body = &apos;&apos;,&#xD;        myself = this;&#xD;    commandBlock.blockSequence().forEach(function (block) {&#xD;        body += myself.compileExpression(block);&#xD;        body += &apos;;\n&apos;;&#xD;    });&#xD;    return body;&#xD;}&quot;</list></item><item><list struct="atomic" id="1032">compileInfix,&quot;function (operator, inputs) {&#xD;    return &apos;(&apos; + this.compileInput(inputs[0]) + &apos; &apos; + operator + &apos; &apos; +&#xD;        this.compileInput(inputs[1]) +&apos;)&apos;;&#xD;}&quot;</list></item><item><list struct="atomic" id="1033">compileInputs,&quot;function (array) {&#xD;    var args = &apos;&apos;,&#xD;        myself = this;&#xD;&#xD;    array.forEach(function (inp) {&#xD;        if (args.length) {&#xD;            args += &apos;, &apos;;&#xD;        }&#xD;        args += myself.compileInput(inp);&#xD;    });&#xD;    return args;&#xD;}&quot;</list></item><item><list struct="atomic" id="1034">compileInput,&quot;function (inp) {&#xD;     var value, type;&#xD;&#xD;    if (inp.isEmptySlot &amp;&amp; inp.isEmptySlot()) {&#xD;        // implicit formal parameter&#xD;        if (this.implicitParams &gt; 1) {&#xD;         	if (this.paramCount &lt; this.implicitParams) {&#xD;            	this.paramCount += 1;&#xD;             	return &apos;p&apos; + (this.paramCount - 1);&#xD;        	}&#xD;            throw new Error(&#xD;                localize(&apos;expecting&apos;) + &apos; &apos; + this.implicitParams + &apos; &apos;&#xD;                    + localize(&apos;input(s), but getting&apos;) + &apos; &apos;&#xD;                    + this.paramCount&#xD;            );&#xD;        }&#xD;		return &apos;p0&apos;;&#xD;    } else if (inp instanceof MultiArgMorph) {&#xD;        return &apos;new List([&apos; + this.compileInputs(inp.inputs()) + &apos;])&apos;;&#xD;    } else if (inp instanceof ArgLabelMorph) {&#xD;    	return this.compileInput(inp.argMorph());&#xD;    } else if (inp instanceof ArgMorph) {&#xD;        // literal - evaluate inline&#xD;        value = inp.evaluate();&#xD;        type = this.process.reportTypeOf(value);&#xD;        switch (type) {&#xD;        case &apos;number&apos;:&#xD;        case &apos;Boolean&apos;:&#xD;            return &apos;&apos; + value;&#xD;        case &apos;text&apos;:&#xD;            // enclose in double quotes&#xD;            return &apos;&quot;&quot;&apos; + value + &apos;&quot;&quot;&apos;;&#xD;        case &apos;list&apos;:&#xD;            return &apos;new List([&apos; + this.compileInputs(value) + &apos;])&apos;;&#xD;        default:&#xD;            if (value instanceof Array) {&#xD;                 return &apos;&quot;&quot;&apos; + value[0] + &apos;&quot;&quot;&apos;;&#xD;            }&#xD;            throw new Error(&#xD;                &apos;compiling does not yet support\n&apos; +&#xD;                &apos;inputs of type\n&apos; +&#xD;                 type&#xD;            );&#xD;        }&#xD;    } else if (inp instanceof BlockMorph) {&#xD;        if (inp.selector === &apos;reportGetVar&apos;) {&#xD;        	if (contains(this.source.inputs, inp.blockSpec)) {&#xD;            	// un-quoted gensym:&#xD;            	return this.gensyms[inp.blockSpec];&#xD;        	}&#xD;         	// redirect var query to process&#xD;            return &apos;arguments[arguments.length - 1].getVarNamed(&quot;&quot;&apos; +&#xD;            	inp.blockSpec +&#xD;            	&apos;&quot;&quot;)&apos;;&#xD;        }&#xD;        return this.compileExpression(inp);&#xD;    } else {&#xD;        throw new Error(&#xD;            &apos;compiling does not yet support\n&apos; +&#xD;            &apos;input slots of type\n&apos; +&#xD;            inp.constructor.name&#xD;        );&#xD;    }&#xD;}&quot;</list></item></list></variable></variables></scene></scenes></project><media name="objects" app="Snap! 7, https://snap.berkeley.edu" version="2"></media></snapdata>