<div dir="ltr">The name firstOrLess: is a little confusing.<div>Maybe something like collectMax: </div><div><br></div><div><br></div><div>Karl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 3, 2015 at 1:30 PM, marcel.taeumel <span dir="ltr">&lt;<a href="mailto:Marcel.Taeumel@hpi.de" target="_blank">Marcel.Taeumel@hpi.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi --<br>
<br>
Is there a better way to get a limited number of elements from a collection<br>
but accept less if the collection is not big enough?<br>
<br>
someObjects size &gt;= 5<br>
  ifTrue: [someObjects first: 5]<br>
  ifFalse: [someObjects].<br>
<br>
Could we add a #firstOrLess:? Similar thoughts on #firstOrNil, #lastOrNil,<br>
and #lastOrLess:.<br>
<br>
Best,<br>
Marcel<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.world.st/firstOrLess-and-lastOrLess-tp4847874.html" rel="noreferrer" target="_blank">http://forum.world.st/firstOrLess-and-lastOrLess-tp4847874.html</a><br>
Sent from the Squeak - Dev mailing list archive at Nabble.com.<br>
<br>
</blockquote></div><br></div>