Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!rutgers!att!pegasus!psrc From: psrc@pegasus.ATT.COM (Paul S. R. Chisholm) Newsgroups: comp.lang.smalltalk Subject: Re: Variable scoping in Smalltalk Summary: Capital Letters Are Global Names Keywords: possibly obscure, not to my knowledge in blue book Message-ID: <2719@pegasus.ATT.COM> Date: 27 Mar 89 03:07:41 GMT References: <935@cs-spool.calgary.UUCP> Distribution: comp Organization: AT&T Bell Laboratories Lines: 25 <"Would you like me to summon Data so he could offer a few dozen synonyms?"> In article <935@cs-spool.calgary.UUCP>, bremner@cpsc.ucalgary.ca (David Bremner) writes: > Object subclass: #Test > instanceVariableNames: 'foo' > classVariableNames: 'Bar' > ... "rest of keywords irrelevant" ... (I've abbreviated the rest of the message) > aMethod > "testing smalltalk variable scoping" > | Bar | "this works" > anotherMethod > "testing smalltalk variable scoping" > | foo | "this doesn't work; Name already defined -> foo" Smalltalk is trying to do you a favor; it doesn't want you to lose access to your instance variable. Names beginning with capital letters are shared. I'm not quite sure what your implementation did with a shared temporary variable. IMHO, it goofed by not forbidding it. >Bremner@UNCA-MULTICS.BITNET, bremner@ksi.cpsc.ucalgary.ca Paul S. R. Chisholm, AT&T Bell Laboratories, att!pegasus!psrc psrc@pegasus.att.com, AT&T Mail !psrchisholm I'm not speaking for the company, I'm just speaking my mind.