<div dir="ltr"><div>Yes, I want that in Squeak too !<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 1 mai 2020 à 18:58, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> a écrit :<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">you might want to adapt this change set into a package, to rename BlockClosure's startups inst var to startpcOrMethod to clear up confusion.<div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 1, 2020 at 9:49 AM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</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 dir="ltr"><div dir="ltr"><div dir="ltr">Hi Max,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 11:51 PM Max Leske <<a href="mailto:maxleske@gmail.com" target="_blank">maxleske@gmail.com</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"><u></u>




<div>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">Hi Sean,</p>

<p dir="auto">You <i>need</i> an outer context. See Context>>cleanCopy, which Fuel uses to serialize blocks.</p></div></div></div></blockquote><div><br></div><div>One does *not* need an outer context.  An outer context of nil should be fine, provided that the block never attempts an up-arrow return.</div><div><br></div><div><br></div><div>| blockMethod |</div><div>blockMethod := [:a :b| a < b] method.</div><div>(FullBlockClosure receiver: nil outerContext: nil method: blockMethod copiedValues: nil) value: 1 value: 2</div><div><br></div><div>So one needs to use FullBlockClosure class>>receiver:outerContext:method:copiedValues: and one can supply nil for the outerContext provided that the block does not do an up-arrow return.</div><div> </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:sans-serif"><div style="white-space:normal">

<p dir="auto">Cheers,<br>
Max</p>

<p dir="auto">On 1 May 2020, at 3:23, Sean P. DeNigris wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid rgb(119,119,119);color:rgb(119,119,119);margin:0px 0px 5px;padding-left:5px"><p dir="auto">What am I not understanding about FullBlockClosure?<br>
<br>
I have a clean block that I'd like to turn into a FullBlockClosure so that I<br>
can serialize it without dragging (unneeded methods) into my object graph.<br>
However, documentation and in-image example usages seem severely limited.<br>
Here was one experiment that ended with a primitive failure. It seems like a<br>
receiver is needed and it can't be a dummy value (see commented "receiver:<br>
1"). But what would the receiver be in the absence of an outer context?!<br>
<br>
aBlockClosure := [ :a :b  | 1 + a + b ].<br>
fbc := (FullBlockClosure<br>
                outerContext: nil<br>
                startpc: aBlockClosure startpc<br>
                numArgs: aBlockClosure argumentCount<br>
                copiedValues: Array new) "receiver: 1; yourself".<br>
<br>
fbc value: 2 value: 3. "PrimitiveFailed: primitive #value:value: in<br>
FullBlockClosure failed"<br>
<br>
<br>
<br>
-----<br>
Cheers,<br>
Sean<br>
--<br>
Sent from: <a href="http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html" style="color:rgb(119,119,119)" target="_blank">http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html</a></p>
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</div>

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