Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!mephisto!udel!new From: new@udel.edu (Darren New) Newsgroups: comp.lang.smalltalk Subject: Re: Question on Ordered Collections Message-ID: <10979@nigel.udel.EDU> Date: 13 Feb 90 13:10:34 GMT References: <1045@prlhp1.prl.philips.co.uk> <10271@nigel.udel.EDU> <1151@cf-cm.UUCP> Sender: usenet@udel.EDU Reply-To: new@udel.edu (Darren New) Distribution: comp.lang.smalltalk Organization: University of Delaware Lines: 35 In article <1151@cf-cm.UUCP> andrew@computing-maths.cardiff.ac.uk (Andrew Jones) writes: >As for making it more flexible, I can't see this. . . . >(or even while adding it: > > ... add: (myVar <- 'hello') ... ). >In other words, getting hold of both the collection and the thing added >seems to require a similar amount of effort in both cases. Speaking from my experience with threaded interpreters (e.g., FORTH), the thing you want to return is the thing you are more likely to have to calculate. (In FORTH, the thing on the top of the stack is the thing you are less likely to calculate, so that it may be passed to another routine.) So in forth, you say BLAH BLECK ! to store BLAH into the variable BLECK. Normally, the right-hand side expression goes left-most so that it is deeper and easier to pass on the stack without SWAPs and ROTs. (Did that make any sense? I thought not. Let me try it using smalltalk...) rememberFrom: xyzzy ^MyCollection add: xyzzy + 2 vs. rememberFrom: xyzzy | t | MyCollection add: (t <- xyzzy + 2). ^t where the + 2 is to represent an arbitrarily complex expression. Anyway, I think this makes my point. However, the power of Smalltalk is sufficiently greater and the libraries are sufficiently larger that the minor inconvenience at coding time is far outweighed by the major inconvenience of not having consistency in the libraries. On the other hand, there is always "yourself" if there is any doubt. I really think at this point it is a matter of taste. -- Darren