<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 5/14/2022 6:21 AM, Luciano Notarfrancesco via Cuis-dev wrote:
    <blockquote
cite="mid:CAL5GDyoQD5dZnYvQNRHPA0Re7X2TEhsE9TPtLyJuxPYsoU+o8w@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div>I added a comment with a warning about reproducibility to
        Collection>>#atRandom:, Set>>#atRandom: and
        Bag>>#atRandom:. I also moved the empty check to the top
        of the methods in Collection>>#atRandom: and
        Bag>>#atRandom:, the idea behind this is that '0 atRandom:
        aGenerator' produces a different error, and doing 'self
        emptyCheck' first is better because if at some point we change
        Collection>>#errorEmptyCollection to signal a new
        exception like say EmptyCollectionException we won't need to
        change these methods. Finally the last line in those two methods
        should never be executed, unless the collection is broken (i.e.
        size returns n, but do: iterates over less than n elements), so
        I just do "self error: 'collection invariants broken'"
        <div><br>
        </div>
        <div>Let me know if you have any more suggestions, I really want
          the kernel classes to be absolutely perfect.</div>
        <div><br>
        </div>
        <div>Thanks!!</div>
        <div>Luciano</div>
      </div>
      <br>
    </blockquote>
    <br>
    At GitHub now. Thanks a lot!<br>
    <br>
    Cheers,<br>
    <pre class="moz-signature" cols="72">-- 
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
<a class="moz-txt-link-freetext" href="https://independent.academia.edu/JuanVuletich">https://independent.academia.edu/JuanVuletich</a>
<a class="moz-txt-link-freetext" href="https://www.researchgate.net/profile/Juan-Vuletich">https://www.researchgate.net/profile/Juan-Vuletich</a>
<a class="moz-txt-link-freetext" href="https://patents.justia.com/inventor/juan-manuel-vuletich">https://patents.justia.com/inventor/juan-manuel-vuletich</a>
<a class="moz-txt-link-freetext" href="https://twitter.com/JuanVuletich">https://twitter.com/JuanVuletich</a></pre>
  </body>
</html>