<div dir="ltr"><div><div>Hi,<br><br>The receiver is not the metaclass but its `soleInstance` i.e SVGMainMorph.</div></div><div><br>class := SVGMainMorph.<br>selectors := class class selectorsInCategory: #examples.<br><br>selectors do: [ :selector |<br> (selector beginsWith: 'example') ifTrue: [<br> (class perform: selector) openInWorld<br> ]<br>]</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 20 Jun 2024 at 01:44, Mark Volkmann 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 dir="ltr"><div>Here are my notes on working with SVGs in Cuis:</div><div><br></div><div>- Open a terminal.<br><br>- Clone the following Git repositories from Cuis Smalltalk:<br><br> - <a href="https://github.com/Cuis-Smalltalk/Numerics.git" target="_blank">https://github.com/Cuis-Smalltalk/Numerics.git</a><br> - <a href="https://github.com/Cuis-Smalltalk/SVG.git" target="_blank">https://github.com/Cuis-Smalltalk/SVG.git</a><br><br>- Open a Workspace window and install the packages `LinearAlgebra` and `SVG.<br><br> For each package, enter `Feature require: '{package-name}'` and "Do it".<br><br>- Enter `SVGMainMorph exampleTiger openInWorld` and "Do it".<br></div><div><br></div><div>Now that I have this working, I wanted to see if I could use reflection to open all the examples.</div><div>I know I can just do this: <font face="monospace">SVGMainMorph openAllExamples SVGMainMorph</font>.</div><div>But I wanted to see if I could do it with reflection. Here is what I tried.</div><div><br></div><div><font face="monospace">metaclass := SVGMainMorph class.<br>selectors := metaclass allMethodsInCategory: #examples.<br>selectors do: [ :selector |<br> (selector beginsWith: 'example') ifTrue: [<br> (MessageSend receiver: metaclass selector: selector) openInWorld<br> ]<br>].</font><br></div><div><br></div><div>This gives me "MessageNotUnderstood" on the send of <font face="monospace">openInWorld</font> because apparently the code "<font face="monospace">MessageSend receiver: metaclass selector: selector</font>" does not return a <font face="monospace">Morph</font>. It's not clear to me why it doesn't.<br><div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></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>