<div id="__MailbirdStyleContent" style="font-size: 12pt;font-family: calibri;color: #000000">
                                        +1<div><br></div><div>#setPinned: looks like it is coming from C land or Java land. :) #pinned:, #pin, and #unpin are more idiomatic for Smalltalk code.</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 01.09.2017 03:01:55 schrieb Chris Muller <asqueaker@gmail.com>:</p>Hi Levente,<br><br>#setPinned: is a private method that provides a physical kind of<br>access to the object, whereas #pinned: is public, conforms to expected<br>naming conventions and allows (proper) overriding.  It provides a<br>logical (abstract) kind of access to #setPinned: as do #pin and<br>#unpin.<br><br>I'd recommend using #pin and #unpin if wherever possible, but there<br>have been enough cases where various method pairs (i.e., #lock/unlock,<br>#show/hide, #action/unaction, etc.) where it can't be known which one<br>is needed until runtime.<br><br>- Chris<br><br>On Thu, Aug 31, 2017 at 5:24 PM, Levente Uzonyi <leves@caesar.elte.hu> wrote:<br>> On Thu, 31 Aug 2017, commits@source.squeak.org wrote:<br>><br>>> Chris Muller uploaded a new version of Kernel to project The Trunk:<br>>> http://source.squeak.org/trunk/Kernel-cmm.1113.mcz<br>>><br>>> ==================== Summary ====================<br>>><br>>> Name: Kernel-cmm.1113<br>>> Author: cmm<br>>> Time: 31 August 2017, 1:55:06.158647 pm<br>>> UUID: 05c89229-0279-4842-b0d0-dacb2713a4b6<br>>> Ancestors: Kernel-tbn.1112<br>>><br>>> Provide #pinned: so clients don't have to write duplicate code (e.g.,<br>>> "myCondition ifTrue: [myObject pin] ifFalse: [myObject unpin]") while<br>>> allowing frameworks to hook #pinned: if necessary (without overriding a<br>>> primitive).<br>><br>><br>> I'd like to see a use-case which justifies the existence of this method.<br>> I also don't see why would you use #pinned: instead of #setPinned:.<br>><br>> Levente<br>><br>><br>>><br>>> =============== Diff against Kernel-tbn.1112 ===============<br>>><br>>> Item was changed:<br>>>  ----- Method: Object>>pin (in category 'pinning') -----<br>>>  pin<br>>> +       "Ensure the receiver is pinned and answer whether it was pinned."<br>>> +       ^ self pinned: true!<br>>> -       "The VM's garbage collector routinely moves objects as it reclaims<br>>> and compacts<br>>> -        memory. But it can also pin an object so that it will not be<br>>> moved, which can make<br>>> -        it easier to pass objects out through the FFI.  Objects are<br>>> unpinnned when created.<br>>> -        This method ensures an object is pinned, and answers whether it<br>>> was already pinned."<br>>> -       ^self setPinned: true!<br>>><br>>> Item was added:<br>>> + ----- Method: Object>>pinned: (in category 'pinning') -----<br>>> + pinned: aBoolean<br>>> +       "The VM's garbage collector routinely moves objects as it reclaims<br>>> and compacts memory. But it can also pin an object so that it will not be<br>>> moved, which can make it easier to pass objects out through the FFI.<br>>> Objects are unpinnned when created.<br>>> +       Answer whether the receiver was pinned."<br>>> +       ^ self setPinned: aBoolean!<br>>><br>>> Item was changed:<br>>>  ----- Method: Object>>setPinned: (in category 'private') -----<br>>>  setPinned: aBoolean<br>>> +       "Primitive which pins or unpins the receiver and answers whether<br>>> it was already pinned."<br>>> -       "The VM's garbage collector routinely moves objects as it reclaims<br>>> and compacts<br>>> -        memory. But it can also pin an object so that it will not be<br>>> moved, which can make<br>>> -        it easier to pass objects out through the FFI.  Objects are<br>>> unpinnned when created.<br>>> -        This primitive either pins or unpins an object, and answers if it<br>>> was already pinned."<br>>>         <primitive: 184="" error:="" ec=""><br>>>         ^self primitiveFailed!<br>>><br>>> Item was changed:<br>>>  ----- Method: Object>>unpin (in category 'pinning') -----<br>>>  unpin<br>>> +       "Ensure the receiver is unpinned and answer whether it was<br>>> pinned."<br>>> +       ^ self pinned: false!<br>>> -       "The VM's garbage collector routinely moves objects as it reclaims<br>>> and compacts<br>>> -        memory. But it can also pin an object so that it will not be<br>>> moved, which can make<br>>> -        it easier to pass objects out through the FFI.  Objects are<br>>> unpinnned when created.<br>>> -        This method ensures an object is unpinned, and answers whether it<br>>> was pinned."<br>>> -       ^self setPinned: false!<br>><br>><br><br></primitive:></leves@caesar.elte.hu>
                        </blockquote></div>