<div dir="ltr">Hi John,<div><br></div><div>I think what you're looking for is #decompile.  For example, if in a workspace you printit on:</div><div><br></div><div>[true ifTrue: [Transcript show: 'testing']]</div><div><br></div><div>you will see:</div><div><br></div><div>[closure] in UndefinedObject>>DoIt <br></div><div><br></div><div>However, if you printit on:</div><div><br></div><div>[true ifTrue: [Transcript show: 'testing']] decompile<br></div><div><br></div><div>you will get source code for the block:</div><div><br></div><div> {[<br>       true ifTrue: [ Transcript show: 'testing' ]. ]}</div><div><br></div><div>One thing to keep in mind is that it is decompiling from bytecode so you will lose things like comments and variable names but it will otherwise be identical to the original source code.</div><div><br></div><div>Thanks,</div><div>Phil <br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 23, 2021 at 1:05 PM John McGarey via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px"><div dir="ltr">HI!</div><div dir="ltr"><br></div><div dir="ltr">   I'm on chapter 6 in the Cuis book and in Figure 6.8 there are a few lines of code that add behavior to just one instance of WidgetMorph.  It actually works great but I got curious and was surprised when I went to look at that code in the inspector and couldn't find it.  All I could find was the word `[closure]` in the place of the block but I bet someone here can do better:   </div><div dir="ltr"><br></div><div dir="ltr">Does any genius here know a tricky or roundabout way to see that block of code after it has been applied? </div><div dir="ltr"><br></div><div dir="ltr">Thank you,</div><div dir="ltr">John</div><div dir="ltr"><br></div><div dir="ltr">Reproducing this:</div><div dir="ltr">Cuis5.0-4928</div><div dir="ltr">Create a new WidgetMorph and inspect it and then put these two lines in the inspector:</div><div dir="ltr">`self setProperty: #handlesMouseDown: toValue: true.</div><div><div>self setProperty: #mouseButton1Up:localPosition: toValue: [:ignoredEvent :ignoredPosition| self color: Color random]</div><div dir="ltr">self hasProperty: #mouseButton1Up:localPosition:`</div></div><div dir="ltr">from p94/95 of The Cuis Book</div></div></div>-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>