[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-30 Thread Richard O'Keefe via Pharo-users
As promised, here is a further issue from the standard, where I think the standard has a good idea but nobody paid any attention. Smalltalk has a practice of providing conversions between classes when that makes sense. They are named #asResult where Result is the result of the conversion. The "as"

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-30 Thread stephane ducasse via Pharo-users
ANSI is dead and this is good. Now this is interesting to learn from the analysis and the APIs. > On 30 Jun 2025, at 14:23, Richard O'Keefe wrote: > > I have the final ANSI Smalltalk standard as published. I obviously > cannot give it to you, but I *can* tell you that painfully few of the >

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-30 Thread stephane ducasse via Pharo-users
Hi richard Thanks for the mail. I would go for the solution 2. 1) Put the test code *inside* the class under test as an extension. Have the test code in the image only when testing. (2) Add the access-to-private-details methods in an extension, included in the image only when testing. (3) What

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-30 Thread Richard O'Keefe via Pharo-users
I have the final ANSI Smalltalk standard as published. I obviously cannot give it to you, but I *can* tell you that painfully few of the obvious errors in the 1.9 draft were corrected. For example, the DateAndTime class. The basic idea is sound, but we are told that the range of zone offsets is -

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-29 Thread Richard O'Keefe via Pharo-users
Ah, the astc copy you found is years out of date. And the deque.st you found has had several mistakes fixed since. Here's why it mattered to me that these data structures weren't Collections. I was writing my own testing and benchmarking code to explore these ones. They have #isEmpty, so naturall

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-29 Thread Alok via Pharo-users
Thnx a lot Richard for such great feedback. We'll definitely update the repo with all the necessary changes. Thanks Stephane for sharing all the resources. I'll definitely go through ANSI :) On Sun, 29 Jun, 2025, 13:40 Sebastian Jordan, wrote: > Hello Richard, > > Thanks for your feedback. Just

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-29 Thread Sebastian Jordan via Pharo-users
Hello Richard, Thanks for your feedback. Just for context we are doing this project for the Google Summer of Code. I agree that the buffer should be polymorphic with the OrderedCollection. Yes, we should signal empty collection when accesing an empty buffer (7) We will rok on that and come bac

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-28 Thread stephane ducasse via Pharo-users
AlokI found inhttp://www.cs.otago.ac.nz/staffpriv/ok/astc-1711.tar.gz deque.st Description: Binary data "File   : deque.st SCCS   : '@(#)2017/08/23 deque.st 1.41' Author : Richard A. O'Keefe Defines: Deque, a non-indexable double-ended queue. Testing: The Squeak version of this has been tested."re

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-27 Thread Richard O'Keefe via Pharo-users
My own Smalltalk library (and yes, I've tried to put it on github, I don't know what I'm doing wrong) includes Deque and BoundedDeque, both descendants of Collection. Using addLast/removeLast gives you a stack (use #last for peeking) Using addLast/removeFirst gives you a queue. (use #first for peek

[Pharo-users] Re: New Circular Buffer Implementation for Pharo

2025-06-27 Thread stephane ducasse via Pharo-users
Thanks this is great! > On 18 Jun 2025, at 12:13, Alok via Pharo-users > wrote: > > Hello Everyone, > We're excited to share a new addition to the pharo-containers > . An efficient Circular Buffer > implementation, developed as part of Google Summer of Cod