[Pharo-project] Stack should be reimplemented with Array

jaayer jaayer at zoho.com
Fri Oct 15 11:52:27 EDT 2010





---- On Fri, 15 Oct 2010 07:41:24 -0700 Guillermo Polito  wrote ---- 

>BTW, why Stack inherits from LinkedList instead of just using it?  Should an Stack have the entire Collection protocol? I don't think so...

That was the subject of the earlier discussion, and yes, I think it should implement all appropriate messages in Collection, including #add: (as #push:), #size and #do:. The Array-based Stack I wrote does not implement #remove:ifAbsent: and only supports removal at the top of the Stack through #pop.





More information about the Pharo-dev mailing list