<snapdata remixID="11906019"><project name="Objects, environments, and dictionaries" app="Snap! 9.0, https://snap.berkeley.edu" version="2"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAIH0lEQVR4Xu2du2tVTxDH5yZBNMYHgtpYiBBBwRSJLxQFRRTEJoVYBASxECwkpvaPEJGAhb2FjaUgiCA+QKIg2PgALRQ1kJ8RoqJJfpkTbozJPffsObuzO3v2e0D0endndr7z2dnHvSSN2bmH8ECBQAo0agfgzJySHRXUrNqvgqsouwjpUz8A1WeXF5yG+lH6GiAAdKC0UHFwMDL9JgBgyRyhfpUUrKA5AHSrJ6yVVEAYQEWLU9uhJFzXPKSonbrCAJacDobNPWhmOJKcZuoHWDE8gXnqD8C6JqViLrV3W5wuAe4WwvcHoHbFVY1PMuV/A/Xjpb2wAFAVeOkNRjmAeXNUw9xNDxaJiJUDKBFyHDZT2TIDwCh4rC+OADAKAGs0yCW7JwBYo9yahqJpBw0AF2VNNDGixk3RM2znccVXAmBM2TFMIpoZKeABQMBllIlEG3kAMFFlEbaRAgDQSCY0klIAAEopC7tGCgBAI5nQSEoBACilbGR2Qx0V/QLo8n4plGKRgaV9uH4BzNRwSWFJeZOHNqD2OakKAGBJaNC81goAwFqnt0RwoqtDvnEAWCJH0TYVhctOlXgBVCyqXUr89g4toz4A9e2T/RKRmDd9ACaWgGrh1meW6gLQla45dlyZrwYNerVSQBeAyJGoAhonIAAUTTmMFymgBMD5uVk4Q1s1KOxUJAHeD6mAEgBDSuDfd+irD/8R53sEgJqykeBYGrMzcz8lHz+yOMHU6wgZFVAoD1NTU/Tz508h6/NmV61alf2J+QGAAtl7+vQpMYA+nnXr1lF/f78PVyI+AgJYz634w4cPae3atdTX1yeSsKVGnzx5Qp2dnbRnzx4v/lw7CQig61B02Lt//z4dOXLE62DY56FDh6irq8urXxfOAKALFRfZCAXg3r17afXq1Y6jkTcHAB1rzAAePnyYNmzYQN++faOBgQH6+vUrff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BdFmVXNpSol+5YRhWhXJG425dCGDc4TkYPaBxIGK+CQAoKi+MFymgCECfC7RPX0UpSPv9fACRI3Vk5KUk5l1CxQqoIGQFQ1BHaIQDqghghJFiyCoVaAEgSovKTNV0UKiANU2s7rD+7madAxjr2aXedd91Vtyp5RxA3TMPo2ulgGs8y6gMAMuohbbOFdAPYMjp6VxuTwYj0kw/gJ5yBjdhFACAYXTPvEZUqOxVyjm3AEB7aWHBQgEAaCEeutorAADtNXRmofnz781/E0X8izgAdIZPIobc3UFngrUG0LGTRFJjFWaqkqMCWmGDzrYKAEBbBdHfSgEAaCWfvs6xLeUAMAhDZqdXs1ZBAnDmVA2AKYjtLGs1MpQLIICoUZYVhyJQAYGu4nyrG5oAgOpiTG9AEdUAAJgeni0iDkesXgDDaQIkPSqgF0CPIsBVOAUAYDjtl3uOqeo7uvEGgJoATHAsCgB0NJWcJk/jmCwCVBPO8hKvAEALYdFVVIG8HYHNTmFp3wxAG4OiCiRoXEuxEmNiieHoK6CWhCU4V5yEHD2ATlQQNiJWTYTH7cM8APShMnzkKgAAAYegAsW1vzE7PTtLHYJjgGko0EYBVEDgEVQBABhUflvn8d8BVAbQOHTjhrbJQP8YFagMYIzBYsz6FACA+nISZkSBVqo0AfQutneHYSCu4DVeAIVzKmy+Qqq4i85RVQwm6yYP4D+aTc+57LQZL/rWTIH/Aa18iMbeRKrtAAAAAElFTkSuQmCC</thumbnail><scenes select="1"><scene name="Objects, environments, and dictionaries"><notes></notes><palette><category name="Objects" color="0,116,143,1"/></palette><hidden></hidden><headers></headers><code></code><blocks><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="sprite of %&apos;lambda&apos;" type="reporter" category="sensing"><comment x="0" y="0" w="90" collapsed="false">get the sprite (if any) that a lambda runs in</comment><header></header><code></code><translations></translations><inputs><input type="%obj"></input></inputs><script><block s="doReport"><custom-block s="try %anyUE catch %upvar %anyUE"><block s="evaluate"><block s="reportAttributeOf"><block s="reifyReporter"><autolambda><block s="reportGet"><l><option>self</option></l></block></autolambda><list></list></block><block var="lambda"/></block><list></list></block><l>error</l><l></l></custom-block></block></script></block-definition><block-definition s="object from pairs %&apos;assoc&apos;" type="reporter" category="Objects"><header></header><code></code><translations></translations><inputs><input type="%mult%l"></input></inputs><script><block s="doReport"><custom-block s="%obj with pairs %mult%l"><custom-block s="empty object"></custom-block><block var="assoc"/></custom-block></block></script></block-definition><block-definition s="empty object" type="reporter" category="Objects"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJoinWords"><list><block s="reifyReporter"><autolambda><block s="reifyScript"><script><custom-block s="error %txt"><l>expecting a ring but getting an object</l></custom-block></script><list></list></block></autolambda><list></list></block></list></block><list></list></block></block></script></block-definition><block-definition s="%&apos;object&apos; with pairs %&apos;assoc&apos;" type="reporter" category="Objects"><header></header><code></code><translations></translations><inputs><input type="%obj"></input><input type="%mult%l"></input></inputs><script><block s="doIfElse"><block var="object"/><script><block s="doDeclareVariables"><list><l>columns</l></list></block><block s="doSetVar"><l>columns</l><block s="reportListAttribute"><l><option>columns</option></l><block var="assoc"/></block></block><block s="doReport"><block s="reportAttributeOf"><block var="object"/><block s="evaluate"><block s="reportAttributeOf"><block s="reportJoinWords"><block s="reportCONS"><block s="reifyScript"><script><block s="doReport"><l></l></block></script><list></list></block><block s="reportCONS"><block s="reifyReporter"><autolambda><block s="reifyReporter"><script></script><list></list></block></autolambda><list></list></block><block s="reportListItem"><l>1</l><block var="columns"/></block></block></block></block><block var="object"/></block><block s="reportListItem"><l>2</l><block var="columns"/></block></block></block></block></script><script><custom-block s="error %txt"><custom-block s="multiline %mlt"><l>Typeerror&#xD;null has no properties</l></custom-block></custom-block></script></block></script></block-definition><block-definition s="values of %&apos;object&apos;" type="reporter" category="Objects"><header></header><code></code><translations></translations><inputs><input type="%obj"></input></inputs><script><block s="doReport"><block s="reportAttributeOf"><block s="reportAttributeOf"><l><option>variables</option></l><block var="object"/></block><block var="object"/></block></block></script></block-definition><block-definition s="assoc of %&apos;object&apos;" type="reporter" category="Objects"><header></header><code></code><translations></translations><inputs><input type="%obj"></input></inputs><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportNewList"><list><l></l><block s="reportAttributeOf"><l></l><block var="object"/></block></list></block></autolambda><list></list></block><block s="reportAttributeOf"><l><option>variables</option></l><block var="object"/></block></block></block></script></block-definition><block-definition s="set %&apos;key&apos; of %&apos;object&apos; to %&apos;val&apos;" type="command" category="Objects"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%obj"></input><input type="%s"></input></inputs><script><block s="doTellTo"><block var="object"/><block s="reportJoinWords"><list><block s="reifyScript"><script><block s="doSetVar"><l></l><l></l></block></script><list></list></block><block var="key"/><block var="val"/></list></block><list></list></block></script><scripts><script x="52" y="245.99999999999994"><block s="doIfElse"><custom-block s="try %anyUE catch %upvar %anyUE"><custom-block s="ignore %s and report %s"><block s="reportAttributeOf"><block var="key"/><block var="object"/></block><block s="reportBoolean"><l><bool>true</bool></l></block></custom-block><l>error</l><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><script></script><script><block s="doTellTo"><block var="object"/><block s="reportJoinWords"><list><block s="reportNewList"><list><block s="reifyScript"><script><block s="doDeclareVariables"><list><l> </l></list></block></script><list></list></block><block var="key"/></list></block><block s="reportNewList"><list><block s="reifyScript"><script><block s="doSetVar"><l></l><l></l></block></script><list></list></block><block var="key"/><block var="val"/></list></block></list></block><list></list></block></script></block></script></scripts></block-definition><block-definition s="multiline %&apos;text&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%mlt"></input></inputs><script><block s="doReport"><block var="text"/></block></script></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;</translations><inputs><input type="%s"></input></inputs></block-definition><block-definition s="ignore %&apos;x&apos; and report %&apos;val&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block var="val"/></block></script></block-definition><block-definition s="%&apos;x&apos;" type="reporter" category="operators"><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="for each %&apos;key&apos; , %&apos;value&apos; of %&apos;object&apos; %&apos;script&apos;" type="command" category="Objects"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%upvar"></input><input type="%obj"></input><input type="%ca"></input></inputs><script><block s="doForEach"><l>k</l><block s="reportAttributeOf"><l><option>variables</option></l><block var="object"/></block><script><block s="doSetVar"><l>key</l><block var="k"/></block><block s="doSetVar"><l>value</l><block s="reportAttributeOf"><block var="k"/><block var="object"/></block></block><block s="doRun"><block var="script"/><list></list></block></script></block></script></block-definition><block-definition s="let %&apos;vars&apos; = %&apos;vals&apos;" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%scriptVars"></input><input type="%mult%s"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doRun"><custom-block s="%obj with pairs %mult%l"><block var="cont"/><block s="reportListAttribute"><l><option>columns</option></l><block s="reportNewList"><list><block var="vars"/><block var="vals"/></list></block></block></custom-block><list></list></block></script><list><l>cont</l></list></block></block></script></block-definition><block-definition s="split script var blocks from pairs %&apos;assoc&apos;" type="reporter" category="other" helper="true"><header></header><code></code><translations></translations><inputs><input type="%mult%l"></input></inputs><script><block s="doDeclareVariables"><list><l>blocks</l></list></block><block s="doSetVar"><l>blocks</l><block s="reportNewList"><list></list></block></block><block s="doForEach"><l>pair</l><block var="assoc"/><script><block s="doAddToList"><block s="reportNewList"><list><block s="reifyScript"><script><block s="doDeclareVariables"><list><l> </l></list></block></script><list></list></block><block s="reportListItem"><l>1</l><block var="pair"/></block></list></block><block var="blocks"/></block><block s="doAddToList"><block s="reportCONS"><block s="reifyScript"><script><block s="doSetVar"><l></l><l></l></block></script><list></list></block><block var="pair"/></block><block var="blocks"/></block></script></block><block s="doReport"><block var="blocks"/></block></script></block-definition><block-definition s="try %&apos;this&apos; catch %&apos;error&apos; %&apos;that&apos;" type="reporter" category="control"><comment x="0" y="0" w="316.6666666666667" collapsed="false">Catch errors in a reporter.&#xD;&#xD;Evaluates its first input.  If that expression successfully reports a value, this block reports that value.  If the expression causes a Snap! error,&#xD;then the final input slot is evaluated with the text of what would have&#xD;been the error message in variable ERROR.  SAFELY TRY then reports the value of that final expression.&#xD;&#xD;Sometimes you&apos;ll want to throw an error in the final expression.  You&#xD;can put an ERROR block inside a CALL block to do that.</comment><header></header><code></code><translations>ca:prova de forma segura reportant _ i si _ reportant _&#xD;</translations><inputs><input type="%anyUE"></input><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doDeclareVariables"><list><l>value</l></list></block><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doSetVar"><l>value</l><block s="evaluate"><block var="this"/><list></list></block></block></script><l>err</l><script><block s="doSetVar"><l>error</l><block var="err"/></block><block s="doSetVar"><l>value</l><block s="evaluate"><block var="that"/><list></list></block></block></script></custom-block><block s="doReport"><block var="value"/></block></script></block-definition><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="control"><comment x="0" y="0" w="276" collapsed="false">Catch errors.&#xD;&#xD;Runs the first script.  If it succeeds, nothing else happens.&#xD;But if it has an error (something that would otherwise result&#xD;in a red halo around the block), then the second script is run,&#xD;with the text of the error message that would have been shown in the variable ERROR.</comment><header></header><code></code><translations>pt:tenta executar _ e, em caso de erro _ , executa _&#xD;ca:prova de forma segura _ i si _ _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block var="action"/><block var="handler"/><block var="error"/></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></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="false" inheritance="true" sublistIDs="false" id="402"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+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+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAEC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cIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list struct="atomic" id="403"></list></costumes><sounds><list struct="atomic" id="404"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="5" y="10" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="409"><costumes><list struct="atomic" id="410"></list></costumes><sounds><list struct="atomic" id="411"></list></sounds><blocks></blocks><variables></variables><scripts><comment x="9.09090909090909" y="9.09090909090909" w="353" collapsed="false">PURPOSE:&#xD;&#xD;environments can be used essentially as first class dictionaries, and functionality nicely goes both ways.&#xD;&#xD;objects are used for the input because it&apos;s distinctive and in practice isn&apos;t good for sprites/stage. objects also have environments that can be worked with here, and the term &quot;object&quot; often refers to dictionaries with inheritance like this in other languages&#xD;i don&apos;t think the snap devs like this terminology, but i like it, even after working with the source code where this isn&apos;t at ALL what object means</comment><comment x="9.09090909090909" y="183.09090909090907" w="457" collapsed="false">THINGS THAT CAN&apos;T BE DONE YET:&#xD;&#xD;object from multiple objects (with inheritance)&#xD;add property to existing object (with sideeffects)&#xD;&#xD;remove property from existing object (with sideeffects)&#xD;object without property/properties (new object, no sideeffects)&#xD;&#xD;is identical to (no way to compare lambdas, which means no way to compare environments)&#xD;find what values are inherited and from what</comment><comment x="9.09090909090909" y="345.0909090909091" w="338.33333333333337" collapsed="false">THINGS THAT MIGHT NOT WORK SOON:&#xD;&#xD;EMPTY OBJECT and everything that uses it (there&apos;s plans to make joined blocks capture globals, which will put all global variables in it by default)&#xD;&#xD;LET steals the variadic upvar from the script variables block, which isn&apos;t supposed to happen</comment><comment x="9.09090909090909" y="471.0909090909088" w="341" collapsed="false">INTENTIONALLY LEFT OUT:&#xD;&#xD;things that can&apos;t be done reasonably fast (if it has to convert to an assoc, i don&apos;t consider it worth making a block for)&#xD;many things demonstrated in the scripts here (readable enough)</comment><script x="9.09090909090909" y="573.0909090909091"><custom-block s="sprite of %obj"><block s="reifyReporter"><autolambda><block s="getPosition"></block></autolambda><list></list></block><comment w="212" collapsed="false">get sprite (if any) that a functions is bound to&#xD;for example, the position given is of this sprite, since it was created in this sprite</comment></custom-block></script><script x="9.09090909090909" y="654.0909090909091"><block s="reportAttributeOf"><block s="reportJoinWords"><list><l>key</l></list></block><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>key</l><l>val</l></list></block></list></custom-block><comment w="90" collapsed="false">get a value from an object</comment></block></script><script x="9.09090909090909" y="723.0909090909091"><block s="reportAttributeOf"><l><option>variables</option></l><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>key</l><l>val</l></list></block></list></custom-block><comment w="90" collapsed="false">get all keys of an object</comment></block></script><script x="9.09090909090909" y="792.0909090909091"><custom-block s="values of %obj"><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>key</l><l>val</l></list></block></list></custom-block><comment w="90" collapsed="false">get all values of an object</comment></custom-block></script><script x="9.09090909090909" y="861.0909090909089"><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>key</l><l>val</l></list></block></list></custom-block></script><script x="9.09090909090909" y="898.0909090909095"><custom-block s="assoc of %obj"><custom-block s="%obj with pairs %mult%l"><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>a</l><l>a</l></list></block><block s="reportNewList"><list><l>b</l><l>b</l></list></block></list></custom-block><list><block s="reportNewList"><list><l>b</l><l>c</l></list></block><block s="reportNewList"><list><l>c</l><l>c</l></list></block></list></custom-block><comment w="106" collapsed="false">WITH PAIRS can replace existing keys</comment></custom-block></script><script x="9.09090909090909" y="967.0909090909091"><block s="doDeclareVariables"><list><l>parent</l><l>child</l></list><comment w="154" collapsed="false">WITH PAIRS inherits properties, unless new or overridden</comment></block><block s="doSetVar"><l>parent</l><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>parent</l><l>parent</l></list></block><block s="reportNewList"><list><l>overridden</l><l>parent</l></list></block></list></custom-block></block><block s="doSetVar"><l>child</l><custom-block s="%obj with pairs %mult%l"><block var="parent"/><list><block s="reportNewList"><list><l>child</l><l>child</l></list></block><block s="reportNewList"><list><l>overridden</l><l>parent</l></list></block></list></custom-block></block><custom-block s="set %txt of %obj to %s"><l>parent</l><block var="child"/><l>side effect!</l></custom-block><custom-block s="set %txt of %obj to %s"><l>child</l><block var="child"/><l>side effect!</l></custom-block><custom-block s="set %txt of %obj to %s"><l>overridden</l><block var="child"/><l>side effect!</l></custom-block><block s="doReport"><custom-block s="assoc of %obj"><block var="parent"/></custom-block></block></script><script x="9.09090909090909" y="1190.2575757575758"><block s="reportListAttribute"><l><option>length</option></l><block s="reportAttributeOf"><l><option>variables</option></l><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>key</l><l>val</l></list></block></list></custom-block></block><comment w="90" collapsed="false">amount of properties</comment></block></script><script x="9.09090909090909" y="1259.257575757576"><custom-block s="for each %upvar , %upvar of %obj %ca"><l>key</l><l>value</l><custom-block s="object from pairs %mult%l"><list><block s="reportNewList"><list><l>a</l><l>1</l></list></block><block s="reportNewList"><list><l>b</l><l>2</l></list></block></list></custom-block><script><block s="bubble"><block s="reportNewList"><list><block var="key"/><block var="value"/></list></block></block><block s="doWait"><l>1</l></block></script></custom-block><block s="bubble"><l></l></block></script><script x="9.09090909090909" y="1383.090909090909"><custom-block s="let %scriptVars = %mult%s"><list><l>a</l><l>b</l><l>c</l></list><list><l>1</l><l>2</l><l>3</l></list><comment w="281.66666666666674" collapsed="false">create and assign to many variables at once&#xD;this doesn&apos;t use the variable getters/setters library! just beautiful metaprogramming. i&apos;d like to know what jens thinks</comment></custom-block></script><script x="9.09090909090909" y="1464.0909090909088"><custom-block s="let %scriptVars = %mult%s"><list><l>a</l><l>b</l><l>c</l></list><block s="reportNumbers"><l>1</l><l>3</l></block></custom-block></script><script x="662.2727272727274" y="18.666666666666845"><block s="doResetTimer"><comment w="90" collapsed="false">168.5 seconds</comment></block><block s="doDeclareVariables"><list><l>a</l><l>b</l></list></block><block s="doSetVar"><l>a</l><block s="reportNewList"><list></list></block></block><block s="doFor"><l>i</l><l>1</l><l>100</l><script><block s="doAddToList"><block s="reportNewList"><list><block s="reportJoinWords"><list><l>i</l><block var="i"/></list></block><block var="i"/></list></block><block var="a"/></block></script></block><block s="doSetVar"><l>b</l><l>0</l></block><block s="doFor"><l>i</l><l>1</l><l>10000</l><script><block s="doChangeVar"><l>b</l><block s="reportListItem"><block s="reportJoinWords"><list><l>i</l><block s="reportRandom"><l>1</l><l>100</l></block></list></block><block var="a"/></block></block></script></block><block s="bubble"><block s="reportJoinWords"><list><block var="i"/><l> </l><block s="getTimer"></block></list></block></block></script><script x="652.8181818181818" y="295.1212121212123"><block s="doResetTimer"><comment w="90" collapsed="false">331 seconds</comment></block><block s="doDeclareVariables"><list><l>a</l><l>b</l></list></block><block s="doSetVar"><l>a</l><block s="reportNewList"><list></list></block></block><block s="doFor"><l>i</l><l>1</l><l>100</l><script><block s="doSetVar"><l>a</l><block s="reportCONS"><block s="reportNewList"><list><block s="reportJoinWords"><list><l>i</l><block var="i"/></list></block><block var="i"/></list></block><block var="a"/></block></block></script></block><block s="doSetVar"><l>b</l><l>0</l></block><block s="doFor"><l>i</l><l>1</l><l>10000</l><script><block s="doChangeVar"><l>b</l><block s="reportListItem"><block s="reportJoinWords"><list><l>i</l><block s="reportRandom"><l>1</l><l>100</l></block></list></block><block var="a"/></block></block></script></block><block s="bubble"><block s="reportJoinWords"><list><block var="i"/><l> </l><block s="getTimer"></block></list></block></block></script><script x="654.6363636363636" y="571.4242424242424"><block s="doResetTimer"><comment w="90" collapsed="false">150.7 seconds</comment></block><block s="doDeclareVariables"><list><l>a</l><l>b</l></list></block><block s="doSetVar"><l>a</l><custom-block s="empty object"></custom-block></block><block s="doFor"><l>i</l><l>1</l><l>100</l><script><block s="doSetVar"><l>a</l><custom-block s="%obj with pairs %mult%l"><block var="a"/><list><block s="reportNewList"><list><block s="reportJoinWords"><list><l>i</l><block var="i"/></list></block><block var="i"/></list></block></list></custom-block></block></script></block><block s="doSetVar"><l>b</l><l>0</l></block><block s="doFor"><l>i</l><l>1</l><l>10000</l><script><block s="doChangeVar"><l>b</l><block s="reportAttributeOf"><block s="reportJoinWords"><list><l>i</l><block s="reportRandom"><l>1</l><l>100</l></block></list></block><block var="a"/></block></block></script></block><block s="bubble"><block s="reportJoinWords"><list><block var="i"/><l> </l><block s="getTimer"></block></list></block></block></script></scripts></sprite><watcher var="global" style="normal" x="10" y="10" color="243,118,29" hidden="true"/></sprites></stage><variables><variable name="global"><l>0</l></variable></variables></scene></scenes></project><media name="Objects, environments, and dictionaries" app="Snap! 9.0, https://snap.berkeley.edu" version="2"></media></snapdata>