<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 21, 2019 at 1:03 PM Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</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">My main objection is about growing the "mutator" nomenclature further<br>
instead of trimming it back.  </blockquote><div><br></div><div>+1</div><div> </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">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></blockquote><div><br></div><div>+1 </div><div> </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">
So, instead of #asMutator and #isMutator, how about #asSimpleSetter and<br>
#isSimpleSetter?<br></blockquote><div><br></div><div>+1</div><div> </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">
<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></blockquote><div><br></div><div>+1000. Chris is right.  isMutator is a mistake.</div><div> </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">
<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>
</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>