<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 20 mai 2019 à 21:19, Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@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"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-m_6162262108032930479gmail-m_-6010438242564715554__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)"><br>Hi, there.<div class="gmail-m_6162262108032930479gmail-m_-6010438242564715554mb_sig"></div><div><br></div><div>I think that all (6) sends in Trunk to #valueWithPossibleArgument: can be replaced with #cull:, which is more flexible.</div></div></blockquote><div><br></div><div>It may be that these replacements can occur in trunk, but please don't let it lead to, "ah, now <span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgument: has no senders so we can deprecate it."   ;-/</span></div><div><br></div><div>For arguments that accept a Collection, coercing a single object into a single-element collection is a useful pattern for improving API usability.  #<span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgument: does that.</span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><br></span></div><div><br></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 id="gmail-m_6162262108032930479gmail-m_-6010438242564715554__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)"><div><br></div><div><img src="cid:16ad69fbdb6cb971f161" width="auto"></div><div><br></div><div><span style="font-size:13.3333px;line-height:20px">Does anyone recall the story of #cull:? Maybe we should just implement #</span><span style="font-size:13.3333px">valueWithPossibleArgument: on MessageSend (and maybe Symbol) to make it more consistent?</span></div></div></blockquote><div><br></div><div>+1.  We should add #<span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgument: to MessageSend (and maybe Symbol), and keep it on BlockClosure too.  It is useful separately from #cull:[...] for certain situations.</span></div><div><br></div><div>Best,</div><div>  Chris</div><div> <br></div></div></div></blockquote><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgument: does one thing more than cull:</span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"></span>it fill missing arguments with nil</div><div>I don't know if this is super useful... I find the feature questionable personnally.</div><div>Anyway, no sender is using this feature, so all senders could rather use cull:<br></div><div><br></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgs: has no equivalent because no cull message takes an Array of arguments.<br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgs: is already understood by MessageSend while <span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">valueWithPossibleArgument: is not which is somehow surprising.</span></span></span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><br></span></span></span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">I'm not sure at all that these two selectors would be good to add to Symbol.</span></span></span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px">For example, Symbol only understand cull: but not cull:cull: nor does it understand valueWithArguments:</span></span></span></div><div><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:Arial;font-size:13.3333px"><br></span></span></span></div><div> <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 class="gmail_quote"><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 id="gmail-m_6162262108032930479gmail-m_-6010438242564715554__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)"><div><span style="font-size:13.3333px"><br></span></div><div><span style="font-size:13.3333px;line-height:20px">For context, here is how I stumbled on it:</span></div><div><span style="font-size:13.3333px">#(1 2 3) collect: #even. "Works." </span></div><div><span style="font-size:13.3333px">1 ifNotNil: #even. "Works."</span></div><div><span style="font-size:13.3333px">#(1) ifNotEmpty: #first. "Does not work."</span></div><div><span style="font-size:13.3333px"><br></span></div><div><span style="font-size:13.3333px">Please note that this question is not about "#(1 2 3) collect: #even" versus "#(1 2 3) collect: [:ea | ea even]". ;-) This is more like a case of surprising inconsistency...</span></div><div><span style="font-size:13.3333px"><br></span></div><div><span style="font-size:13.3333px;line-height:20px">Best,</span></div><div><span style="font-size:13.3333px;line-height:20px">Marcel</span></div></div><br>
</blockquote></div></div>
<br>
</blockquote></div></div>