<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>thank you for the examples. :-)</p>
<p><br>
</p>
<p>I only wanted to note that #in: is not an uncritized idiom, but personally, I am not a general opponent to it.</p>
<p>When I use #in:, I mostly do this to keep cascades intact like in your #addMorph: example.</p>
<p>However, this situation usually would not apply to your collection example. In this case, as far as I can see, the very only purpose of #allIn: would be to add another scope inside a method.</p>
<p>As already mentioned in some other discussion about #in:, I see the latter pattern as a temporary helper construct which in most cases should be the preliminary stage of an "extract method" refactoring for the block passed to #in:.</p>
<p><br>
</p>
<p>That being said, I am not against a new convenience selector that does not harm in any way. :-) I am only wondering whether adding a new selector like this means that it would be okay to use it for Inbox/Trunk submissions or whether the list of the acceptable/considered-good-style
 protocols is a true subset of all protocols that we provide in the Trunk.</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 27. Oktober 2021 15:50:01<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-mt.961.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi all --
<div><br>
</div>
<div>If you don't like to use #in:, this is probably not for you.</div>
<div><br>
</div>
<div>However, if you occasionally use #in: to tweak longer cascades or to avoid a method-local temps in favor of block-scopes, #allIn: expands #in: to multiple variables.</div>
<div><br>
</div>
<div>#in: and #allIn: would allow you to work with an extra scope (and names) to clarify your code as needed. <span style="font-size: 10pt">It's not without alternatives. Regular temps can do everything that #in: can do.</span></div>
<div><br>
</div>
<div>| instance |</div>
<div>instance := Morph new.</div>
<div>self addMorph: instance.</div>
<div>^ instance</div>
<div><br>
</div>
<div>vs.</div>
<div><br>
</div>
<div>^ Morph new</div>
<div>   in: [:instance | self addMorph: instance];</div>
<div>   yourself</div>
<div><br>
</div>
<div>It's not that important. :-) The second style makes it easier to be commented-out in its entirety, for example.</div>
<div><br>
</div>
<div>Here is another example for using fresh bindings:</div>
<div><br>
</div>
<div>{ SomePreferenceObject . PreferenceObject new } allIn: [:old :new |</div>
<div>   ...</div>
<div>   SomePreferenceObject := new].</div>
<div><br>
</div>
<div>#allIn: seems not too important since it can easily be simulated with #in:. Not sure. Probably needs more use cases. During the past years, I only found very few situations where I would prefer #in: over extra temps. I one case, my goal was a one-liner
 to make the text-diff look more compact. =)</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 27.10.2021 14:51:42 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif">
<p>Hi Marcel, could you maybe share some practical examples for #allIn:? I know that many people dislike #in:, too, as it can be used as just another dubious dispatch ...</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Mittwoch, 27. Oktober 2021 13:27:06<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Collections-mt.961.mcz</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText">A new version of Collections was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-mt.961.mcz">http://source.squeak.org/inbox/Collections-mt.961.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-mt.961<br>
Author: mt<br>
Time: 27 October 2021, 1:27:04.102238 pm<br>
UUID: ff529f7f-b6c8-da48-91cf-201db580c537<br>
Ancestors: Collections-eem.960<br>
<br>
Propose addition of #allIn:. See comment. Please review and discuss.<br>
<br>
=============== Diff against Collections-eem.960 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Array>>allIn: (in category 'accessing') -----<br>
+ allIn: aBlock<br>
+        "Use the receivers contents as arguments for aBlock. Truncate not needed arguments, fill in missing ones with nil. Similar to #groupsDo: for single block invocation. Use it to avoid nested calls of #in:.<br>
+        <br>
+        Note that this is implemented here in Array to allow its use only in literal arrays."<br>
+        <br>
+        ^ aBlock valueWithEnoughArguments: self!<br>
<br>
<br>
</div>
</span></span></div>
</blockquote>
</div>
</div>
</body>
</html>