Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!pasteur!ames!pacbell!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.misc Subject: Re: Var scoping in Wirth-type languages Message-ID: <4047@ihlpf.ATT.COM> Date: 18 Mar 88 18:05:52 GMT References: <2791@enea.se> <3949@ihlpf.ATT.COM> <2832@enea.se> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 25 In article <2832@enea.se> sommar@enea.UUCP(Erland Sommarskog) writes: .00704a-Liber,N.J. (nevin1@ihlpf.UUCP) writes: . ..In addition to the standard var declarations, one should be allowed to ..declare a variable 'static' (to steal from C). The scoping would be the ..... ..Note: This optimization can already be done on variables that can be ..determined not to be used recursively and are referenced at a level deeper ..then they are declared. However, by adding explicit static declarations, ..the programmer has much more flexibility. Comments?? . .It seems to me that compiler should have the headache to decide which .variables should be static, not the programmer. I did not propose to eliminate that 'headache' from the compiler (see the word 'addition' in my first sentence) but to allow the user to specify variables he wishes to use on more than one level but allows recursive calls to use the same variable. With a type 'static', he can declare global-type (quick-access) variables AND restrict their scope. This would be in *addition* to the standard types of variable declarations. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_