<div dir="ltr"><div><div>That&#39;s the limit of select:thenCollect:, it would have to be declined into select:thenCollect:as:...<br><br></div>Anyway, #CustomEvents was a value of the Dictionary no?<br>So you would not expect removeKey: to remove a value, would you?<br>
<br>It could be:<br><br>aList := ((self allStandardVocabularies select: #representsAType) collect:  #vocabularyName as: Array) sorted.<br>Preferences allowEtoyUserCustomEvents ifFalse: [^aList copyWithout: #CustomEvents].<br>
</div>^aList<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/6 Bob Arning <span dir="ltr">&lt;<a href="mailto:arning315@comcast.net" target="_blank">arning315@comcast.net</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">The issue is that Dictionary&gt;&gt;collect:
      used to return an OrderedCollection. Now it returns a Dictionary.<br>
      <br>
      Cheers,<br>
      Bob<br>
      <br>
    </font><div><div class="h5">
    <div>On 9/6/13 10:07 AM, Bert Freudenberg
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>On 2013-09-06, at 08:21, Frank Shearar <a href="mailto:frank.shearar@gmail.com" target="_blank">&lt;frank.shearar@gmail.com&gt;</a> wrote:

</pre>
      <blockquote type="cite">
        <pre>On 6 September 2013 00:59,  <a href="mailto:commits@source.squeak.org" target="_blank">&lt;commits@source.squeak.org&gt;</a> wrote:
</pre>
        <blockquote type="cite">
          <pre>A new version of Protocols was added to project The Inbox:
<a href="http://source.squeak.org/inbox/Protocols-jmck.44.mcz" target="_blank">http://source.squeak.org/inbox/Protocols-jmck.44.mcz</a>

==================== Summary ====================

Name: Protocols-jmck.44
Author: jmck
Time: 5 September 2013, 7:59:50.198 pm
UUID: c4a851ef-6f9c-6f43-b0f4-b4ff12060089
Ancestors: Protocols-fbs.43

Vocabulary class&gt;&gt;typeChoices throws an error if Preferences&gt;&gt;allowEtoysUserCustomEvents is false
Mantis #7786

=============== Diff against Protocols-fbs.43 ===============

Item was changed:
 ----- Method: Vocabulary class&gt;&gt;typeChoices (in category &#39;type vocabularies&#39;) -----
 typeChoices
       &quot;Answer a list of all user-choosable data types&quot;

       | aList |
       (aList := self allStandardVocabularies
               select:
                       [:aVocab | aVocab representsAType]
               thenCollect:
                       [:aVocab | aVocab vocabularyName]).
+       Preferences allowEtoyUserCustomEvents ifFalse: [aList removeKey: #CustomEvents].
-       Preferences allowEtoyUserCustomEvents ifFalse: [aList remove: #CustomEvents ifAbsent: []].
       ^ aList asSortedArray!
</pre>
        </blockquote>
        <pre>
I&#39;m not in front of an image right now, but I find it a bit strange
that something Dictionary-y like #removeKey: is being sent to
something called &quot;aList&quot;.

If aList will contain a Dictionary sometimes and a list-like
collection (Array, OrderedCollection) other times, first let me run
and hide in a corner so my crying doesn&#39;t upset anyone, and second
let&#39;s change the variable name to aListOrDictionary.
</pre>
      </blockquote>
      <pre>
No, the proposed &quot;fix&quot; is just plain wrong.

#allStandardVocabularies answers an IdentityDictionary, and aList is an OrderedCollection (at least in the Etoys image) so the original #remove:ifAbsent: makes sense, whereas #removeKey: does not.

- Bert -




</pre>
    </blockquote>
    <br>
  </div></div></div>

<br><br>
<br></blockquote></div><br></div>