<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 16, 2019 at 2:55 AM Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-709602035930772666divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<div id="gmail-m_-709602035930772666divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols" dir="ltr">
<p>Hi Marcel,</p>
<p>as I see it, this Blocks check only restricts the possible hits, so removing it should not damage any existing functionality. (I am *not* talking about modifying <span>Dangerous!)</span></p>
<p>And if you do</p>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols" dir="ltr">
<p><span>MethodFinder methodFor: {{#(1 2). [:x | Smalltalk saveSession. false]}.#()} "pls don't run this!"</span></p>
</div>
</blockquote>
<div style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols" dir="ltr">
<p><span>you will surely expect the side effects to be executed?</span></p></div></div></div></blockquote><div><br></div><div>If MethodFinder were implemented using simulation (a la Context class>>runSimulated:) then we could implement a proper sandbox and completely discard Dangerous.  We could catch any attempt to change the class hierarchy, save a snapshot, etc.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-709602035930772666divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr"><div style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols" dir="ltr">
<p><span style="font-size:12pt">> </span><span style="font-size:12pt">Just curious: what would be the block example for these examples?</span></p>
<p></p>
<p><span></span></p>
<div>MethodFinder methodFor: {{#(1 2). #even}. #(1)}. <b>'(data1 reject: data2) '</b></div>
<div>MethodFinder methodFor: {{#(1 2). #yourself descending}. #(2 1)}. <b>'(data1 sorted: data2) (data1 sort: data2) '</b></div>
<div><br>
</div>
Hey, maybe we should make a small game of it? :-) GuessTheSelectorGame :D
<p></p>
<p><span>Christoph</span></p>
<div id="gmail-m_-709602035930772666Signature">
<div name="divtagdefaultwrapper">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-709602035930772666divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a>> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 16. Oktober 2019 10:54 Uhr<br>
<b>An:</b> gettimothy via Squeak-dev; <a href="mailto:squeak-dev@mail.squeak.org" target="_blank">squeak-dev@mail.squeak.org</a><br>
<b>Betreff:</b> Re: [squeak-dev] MethodFinder.Blocks</font>
<div> </div>
</div>
<div>
<div id="gmail-m_-709602035930772666__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
Hi, Christoph.
<div><br>
</div>
<div>The method finder (or selector browser) has a hard-coded list of possible results (or messages) to not trigger dangerous side effects. Any new feature, such as that "quasi higher-order-message" symbol , would have to be added. Sure. But keep compatiblility
 with block arguments. :-)</div>
<div><br>
</div>
<div>Just curious: what would be the block example for these examples?</div>
<div><br>
</div>
<div><span style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">MethodFinder methodFor: {{#(1 2). #even}. #(1)}</span></div>
<div><span style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">MethodFinder methodFor: {{#(1 2). #yourself descending}. #(2 1)}.</span></div>
<div><span style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br>
</span></div>
<div><span style="font-family:Calibri,Helvetica,sans-serif;font-size:16px">Especially the latter seems kind of cryptic to me.</span></div>
<div><span style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><br>
</span></div>
<div>Best,</div>
<div>Marcel</div>
<div><br>
</div>
<div></div>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
<p style="color:rgb(170,170,170);margin-top:10px">Am 14.10.2019 01:27:12 schrieb Thiede, Christoph <<a href="mailto:christoph.thiede@student.hpi.uni-potsdam.de" target="_blank">christoph.thiede@student.hpi.uni-potsdam.de</a>>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="gmail-m_-709602035930772666divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi all,</p>
<p><br>
</p>
<p>I just got irritated as I evaluated</p>
<p><br>
</p>
<p><span>MethodFinder methodFor: {{#(1 2). #even}. #(1)}</span></p>
<p><br>
</p>
<p>and got no hit.</p>
<p>This is because the MethodFinder stores an extra list of selector parameters that are assumed to require a block argument (Blocks) -- but nowadays this requirement is not given, as you can pass a Symbol, MessageSend, SortFunction or whatsoever, thanks to
 polymorphy. So (how) is this block check still relevant? If I remove it, I get the right hit and can do thinks like</p>
<p><br>
</p>
<p><span>MethodFinder methodFor: {{#(1 2). #yourself descending}. #(2 1)}.</span><br>
</p>
<p><span><br>
</span></p>
<p><span>Also, #ifError: will prevent any error thrown if the block does not match the selector.</span></p>
<p><br>
</p>
<p>Looking forward to your answers :)</p>
<p>Christoph</p>
<div id="gmail-m_-709602035930772666Signature">
<div name="divtagdefaultwrapper">
<div><span style="font-size:10pt;color:rgb(128,128,128)"></span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>

<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>