<div dir="ltr"><div>Hi</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 28, 2019 at 8:15 AM <<a href="mailto:patrick.rein@hpi.uni-potsdam.de">patrick.rein@hpi.uni-potsdam.de</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">Sorry to open this up again. I have progressed well in shuffling things around. However: While moving the corresponding test cases I noticed that there is also #isBinary, #isDoIt, #isInfix, #isUnary, #isKeyword, and #isPvtSelector implemented on Symbol. Given that these all exist, I would rather keep #asSimpleSetter, #isSimpleSetter, #asSetterSelector in the Collections package.<br>
<br>
Any other oppinions on that?<br></blockquote><div><br></div><div>isPvtSelector, isUnary, isInfix, isKeyword, isDoIt - all similar to your new isMutator (and all mostly used in MethodFinder, Shout, and occassionally compiler).  I'd prefer to see them moved off to tools/system/compiler similarly, although that feeling isn't as strong as some of the other commentators previously.  But it is re-enforced by the #isBinary selector.<br></div><div> </div><div>#isBinary is a stinker.  First off, it just delegates to #isInfix on Symbol.  But it is also on many other classes in Collections, where it deals with wheither or not the stream is a binary stream or not - in other words, completely unrelated to the meaning of #isBinary on Symbol (and shoutParser).  I would think pulling this one out for sure from Collections would be good - even better would be to stop using it for this purpose and instead directly use #isInfix.  (Although I suspect it is called from packages outside of base Squeak - maybe VMMaker?)</div><div><br></div><div>If you don't want to move these, I'd be happy too (as long as overall consensus doesn't swing away from this direction).</div><div><br></div><div>Thanks,<br></div><div>cbc</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Bests<br>
Patrick<br>
<br>
>Sounds good to me! <br>
><br>
>How about the following: I would deprecate #asMutator/#isMutator in favor of #asSimpleSetter and #isSimpleSetter. At the same time I would move the #asSimpleSetter up from Symbol to String where #asSetterSelector already resides. Finally, I would move both pairs of selectors to the Tools (or System or Compiler?) package (I would rather not keep them scattered across MorphicExtras and Etoys as common selectors would then also be used by System).<br>
><br>
>Bests,<br>
>Patrick<br>
><br>
>><br>
>><br>
>>On Thu, Mar 21, 2019 at 1:03 PM Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>> wrote:<br>
>><br>
>>My main objection is about growing the "mutator" nomenclature further<br>
>>instead of trimming it back. <br>
>><br>
>><br>
>>+1 <br>
>><br>
>>I'm working on a GraphQL framework.<br>
>>GraphQL has a first-class notion of "mutations".<br>
>><br>
>><a href="https://graphql.org/learn/queries/" rel="noreferrer" target="_blank">https://graphql.org/learn/queries/</a><br>
>><br>
>>Currently, we have almost zero mention of the word<br>
>>"mutator" in the image. I would appreciate if, instead of germinating<br>
>>the overloading the word, we uproot it and keep the nomenclature for<br>
>>this Smalltalk tooling confined to "getter" and "setter" that we have<br>
>>now.<br>
>><br>
>><br>
>>+1 <br>
>><br>
>>So, instead of #asMutator and #isMutator, how about #asSimpleSetter and<br>
>>#isSimpleSetter?<br>
>><br>
>><br>
>>+1 <br>
>><br>
>><br>
>>We can end up removing a method instead of adding one. We already<br>
>>have many existing methods which are dealing with this conversion, all<br>
>>of which use the traditional Smalltalk / developer linguisitic of<br>
>>"setter". Browsing through all the "setter" nomenclature we have in a<br>
>>message names browser, including<br>
>><br>
>>Utilities class>>#getterSelectorFor:<br>
>>Utilities class>>#setterSelectorFor:<br>
>>Utilities class>>#simpleSetterFor:<br>
>><br>
>>which instruct Etoys users to use existing methods on String,<br>
>>#asSetterSelector or #asSimpleSetter.<br>
>><br>
>>Of special note is SyntaxMorph>>#isStandardSetterKeyword: which, by<br>
>>its use of a utility-method implementation, acknowledges that this<br>
>>behavior is _application-specific_.<br>
>><br>
>>I, myself, would just write:<br>
>><br>
>>someSelector asSimpleSetter = someSelector "same as isMutator /<br>
>>isSimpleSetter"<br>
>><br>
>>instead of #isSimpleSetter, but can appreciate both styles. They both<br>
>>better avoid the awkwardness of "mutator" as a general, reliable<br>
>>behavior when:<br>
>><br>
>>#at: isMutator "true"<br>
>><br>
>>while<br>
>><br>
>>#at:put: isMutator "false"<br>
>><br>
>><br>
>>+1000. Chris is right. isMutator is a mistake. <br>
>><br>
>><br>
>>Best,<br>
>>Chris<br>
>><br>
>><br>
>><br>
>>On Thu, Mar 21, 2019 at 1:16 AM <<a href="mailto:patrick.rein@hpi.uni-potsdam.de" target="_blank">patrick.rein@hpi.uni-potsdam.de</a>> wrote:<br>
>>><br>
>>> Which one are you refering to? I only see Symbol>>#asMutator in Collections in the method category converting. It is also used in a few other places beyond generating instance variable accessors.<br>
>>><br>
>>> Bests,<br>
>>> Patrick<br>
>>><br>
>>> >#asMutator: is for "generate instVar accessors" code-generation, and<br>
>>> >that's why it's in the Tools package.<br>
>>> ><br>
>>> >IMHO, if #isMutator belongs anywhere, it isn't in Collections.<br>
>>> ><br>
>>> >Regards,<br>
>>> > Chris<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> >On Wed, Mar 20, 2019 at 3:08 PM Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>> wrote:<br>
>>> >><br>
>>> >> Assuming a single-keyword is a mutator? Object>>#at: is not a<br>
>>> >> mutator. #indexOf: is not. #first: is not. Obviously many more..<br>
>>> >><br>
>>> >> If API balance is the goal of this, perhaps #asMutator should be<br>
>>> >> removed instead. This feels application-specific...<br>
>>> >><br>
>>> >> On Wed, Mar 20, 2019 at 2:05 PM <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br>
>>> >> ><br>
>>> >> > Patrick Rein uploaded a new version of Collections to project The Trunk:<br>
>>> >> > <a href="http://source.squeak.org/trunk/Collections-pre.822.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Collections-pre.822.mcz</a><br>
>>> >> ><br>
>>> >> > ==================== Summary ====================<br>
>>> >> ><br>
>>> >> > Name: Collections-pre.822<br>
>>> >> > Author: pre<br>
>>> >> > Time: 20 March 2019, 8:05:20.383677 pm<br>
>>> >> > UUID: 483c4461-cee4-4a4f-82d3-fbc03e7201cc<br>
>>> >> > Ancestors: Collections-dtl.821<br>
>>> >> ><br>
>>> >> > Adds #isMutator to Symbol which is analogous to asMutator.<br>
>>> >> ><br>
>>> >> > =============== Diff against Collections-dtl.821 ===============<br>
>>> >> ><br>
>>> >> > Item was added:<br>
>>> >> > + ----- Method: Symbol>>isMutator (in category 'testing') -----<br>
>>> >> > + isMutator<br>
>>> >> > +<br>
>>> >> > + ^ self isKeyword and: [self numArgs = 1]!<br>
>>> >> ><br>
>>> >> ><br>
>>> ><br>
>>><br>
>><br>
>><br>
>><br>
>>-- <br>
>>_,,,^..^,,,_<br>
>>best, Eliot --000000000000004a690584a05ffa-- <br>
><br>
<br>
</blockquote></div></div>