Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!tank!uxc!iuvax!rutgers!att!alberta!calgary!cpsc!bremner From: bremner@cpsc.ucalgary.ca (David Bremner) Newsgroups: comp.lang.smalltalk Subject: Variable scoping in Smalltalk Summary: Why can't I call temporaries whatever I want? Keywords: possibly obscure, not to my knowledge in blue book Message-ID: <935@cs-spool.calgary.UUCP> Date: 22 Mar 89 00:05:25 GMT Sender: news@calgary.UUCP Reply-To: bremner@ksi.cpsc.ucalgary.ca.UUCP (David Bremner) Distribution: comp Organization: Knowledge Science Lab, U. of Calgary, Calgary, Canada. Lines: 33 I am using ParcPlace Smalltalk-80 Version 2.3 on apollo domain SR10 Suppose I have the class declaration: Object subclass: #Test instanceVariableNames: 'foo' classVariableNames: 'Bar' ... "rest of keywords irrellevant" then the following is a legal method ----------------------- aMethod "testing smalltalk variable scoping" | Bar | ----------------------- But the following is not ------------------------ aMethod "testing smalltalk variable scoping" | foo | ------------------------ generating the error | Name already defined -> foo | What is going on here? Is this the way scoping is defined in the language? If so, where? ----------- BITNET: Bremner@UNCA-MULTICS.BITNET USENET: bremner@ksi.cpsc.ucalgary.ca