<div dir="auto">Gerald,</div><div dir="auto"> Could you run your stuff with these changes to see the real impact? I’d like to see that if possible</div><div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto">Hernan<br clear="all"><br clear="all"><div dir="auto"><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></strong></span></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div style="font-size:12.8px"><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></strong></span></div><div style="font-size:12.8px"><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div></div></div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 6 Feb 2024 at 13:11 Juan Vuletich via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2/6/2024 12:57 PM, Gerald Klix via Cuis-dev wrote:<br>
> On 2/6/24 4:44 PM, Gerald Klix wrote:<br>
>> OMG, what have I done!<br>
>><br>
>> PLEASE DON'T!!!!!!!!!!!!!<br>
>><br>
>> See below.<br>
>><br>
>><br>
>> On 2/6/24 3:56 PM, Juan Vuletich via Cuis-dev wrote:<br>
>>> On 2/1/2024 5:43 PM, Gerald Klix via Cuis-dev wrote:<br>
>>>> Hi all, Hi Juan,<br>
>>>><br>
>>>> I found a glitch in #copyFrom:count.<br>
>>>> IHMO both expression should work:<br>
>>>><br>
>>>> --- snip ---<br>
>>>> 1 to: 10 :: copyFrom: 1 count: 3.<br>
>>>><br>
>>>> 1 to: 10 :: asOrderedCollection copyFrom: 1 count: 3.<br>
>>>> --- snap ---<br>
>>>><br>
>>>> The later creates an empty OrderedCollection and fails.<br>
>>>><br>
>>>> I attached a change set, that replaces sends of #new: with<br>
>>>> sends of #sizeOf: in various methods,<br>
>>>> although some of these methods are special cased<br>
>>>> in OrderedCollection.<br>
>>>><br>
>>>><br>
>>>> Best Regards,<br>
>>>><br>
>>>> Gerald<br>
>>><br>
>>> Thanks Gerald. I integrated this a few days ago. Still, I think that<br>
>>><br>
>>> | n |<br>
>>> n := whatever number.<br>
>>> (AnyCollectionClass new: n) size = n<br>
>>><br>
>>> should _always_ evaluate to true (or fail if it doesn't make sense). <br>
>>> So I pushed some very substantial changes that kept me quite busy <br>
>>> for several days. Now `OrderedCollection new: 10` will fail. Same <br>
>>> for Set, Dictionary, Bag and a few others. I've adjusted many <br>
>>> packages accordingly.<br>
>>><br>
>>> Cheers,<br>
>>><br>
>> Oh my goodness, that breaks so much of my and everyone else's code.<br>
>> Please don't!!!!!<br>
>><br>
>> This behavior was already present in Smalltalk/V for MSDos<br>
>> and in Smalltalk-80 (see: <a href="https://github.com/dbanay/Smalltalk" rel="noreferrer" target="_blank">https://github.com/dbanay/Smalltalk</a>)<br>
>><br>
>> Please note, 40 year ago my computer science education<br>
>> began more or less with Algebraic Specification:<br>
>> I am acutely aware of this inconsistency!<br>
>><br>
>> Everyone – even language lawyers – can like with this invariant:<br>
>> (AnyCollectionClass sizeOf: n) size = n<br>
>><br>
>> Please follow my advice!<br>
>><br>
>><br>
>> Best Regards,<br>
>><br>
>> Gerald<br>
> I am also inclined to quote the ANSI Smalltalk standard:<br>
><br>
> 5.7.20.2 Message: new: count<br>
><br>
> Synopsis<br>
> Create a new collection. The parameter count constrains the number of <br>
> elements in the result.<br>
><br>
> Definition: <collection factory><br>
> Return a new collection that has space for at least count elements.<br>
> Conforming protocols may refine this message. In particular, the <br>
> effect of the parameter count<br>
> should be specified in refinements. It can be used to specify the <br>
> exact number of elements, the<br>
> minimum number, or in some cases can even be interpreted as a hint <br>
> from the programmer, with<br>
> no guarantee that the requested number of instance variables will <br>
> actually be allocated.<br>
> Unless otherwise stated the initial values of elements, if any, of the <br>
> new collection are unspecified.<br>
><br>
> Parameters<br>
> count <integer> unspecified<br>
><br>
> Return Values<br>
> <collection> new<br>
><br>
> Errors<br>
> none<br>
><br>
> Quoted from<br>
> <a href="https://wiki.squeak.org/squeak/uploads/172/standard_v1_9-indexed.pdf" rel="noreferrer" target="_blank">https://wiki.squeak.org/squeak/uploads/172/standard_v1_9-indexed.pdf</a><br>
> Page 227<br>
><br>
> Page 239 is even more specific:<br>
><br>
> 5.7.27.1Message Refinement: new<br>
><br>
> Synopsis<br>
> Create a new object.<br>
><br>
> Definition: <instantiator><br>
> Return a newly created object initialized to a standard initial state.<br>
><br>
> Refinement: <collection factory><br>
> This message has the same effect as sending the message#new:with the <br>
> argument0, and will<br>
> return an empty collection.<br>
><br>
> Refinement: <OrderedCollection factory><br>
><br>
> Create a new <OrderedCollection> that is optimized to store an <br>
> implementation defined number of<br>
> elements. The new collection initially contains no elements.<br>
><br>
> Return Values<br>
> <OrderedCollection>new<br>
><br>
> Errors<br>
> none<br>
><br>
><br>
> Best Regards,<br>
><br>
> Gerald<br>
<br>
I really don't give crap for ANSI Smalltalk.<br>
<br>
But if everyone goes nuts like you about this, we can add a preference.<br>
<br>
Cheers,<br>
<br>
PS: Please don't take offense for my wording. I'm just kidding. We'll do <br>
what is best for the community.<br>
<br>
-- <br>
Juan Vuletich<br>
<a href="http://cuis.st" rel="noreferrer" target="_blank">cuis.st</a><br>
<a href="http://github.com/jvuletich" rel="noreferrer" target="_blank">github.com/jvuletich</a><br>
<a href="http://researchgate.net/profile/Juan-Vuletich" rel="noreferrer" target="_blank">researchgate.net/profile/Juan-Vuletich</a><br>
<a href="http://independent.academia.edu/JuanVuletich" rel="noreferrer" target="_blank">independent.academia.edu/JuanVuletich</a><br>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" rel="noreferrer" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a><br>
<a href="http://linkedin.com/in/juan-vuletich-75611b3" rel="noreferrer" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a><br>
<a href="http://twitter.com/JuanVuletich" rel="noreferrer" target="_blank">twitter.com/JuanVuletich</a><br>
<br>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div></div>