Path: utzoo!attcan!uunet!dalcs!aucs!831059l From: 831059l@aucs.UUCP (Langlois) Newsgroups: comp.lang.smalltalk Subject: Re: Differencs between Smalltalk/V and Smalltalk/V286 Message-ID: <1440@aucs.UUCP> Date: 10 Dec 88 02:47:42 GMT References: <1424@aucs.UUCP> <1428@aucs.UUCP> Reply-To: 831059l@aucs.UUCP (Langlois) Organization: School of Computer Science, Acadia Univ., Nova Scotia Lines: 33 Here is an interesting problem. I wanted to create a class Queue as a subclass of class SortedCollection. An instance of class Queue would have the sortBlock [ :a : b | a < b ] plus some instance variables such as observations (to keep track of the number of objects which entered the queue), maxLength (the maximum length of the queue), etc. To create a new Queue, I tried the following method: new ^(self sortBlock: [ :a :b | a < b]) initialize I then execute the following: |aQueue| aQueue := Queue new I very quickly get a walkback, with the label "stack overflow". I tried this in Smalltalk/V and it worked fine, in Smalltalk/V286, a different story. I thought using a selector other than new might help so I tried newQueue, but not luck. I got the same error. It took a long time but I finally found the solution to the problem. I defined class Queue as a variableSubclass of class SortedCollection. That is why (?) I got the overflow. Just on a whim, I decided to try to define it as a subclass instead and it worked. In Smalltalk/V, SortedCollection is a variableSubclass of OrderedCollection. In Smalltalk/V286, it is a subclass of OrderedCollection. Take a guess at whether it was documented as a change from V to V286!!! Steven Langlois UUCP: {uunet|watmath|utai|garfield}!dalcs!aucs!831059l Acadia University BITNET: Steven@Acadia Wolfville, NS Internet: Steven%Acadia.BITNET@CUNYVM.CUNY.EDU CANADA B0P 1X0