From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1a88c4d509f6381 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: scope and/or parameters (beginner) Date: 1999/04/14 Message-ID: <7f2do4$drs$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 466319045 References: <37064309.889106243@news.dsuper.net> <37084459.8616007@rocketmail.com> <370b0c99.1137352783@news.dsuper.net> <7ei04q$o$1@nnrp1.dejanews.com> <7et4vr$sdj$1@nnrp1.dejanews.com> <7euskv$d91$1@nnrp1.dejanews.com> <7evbei$opm$1@nnrp1.dejanews.com> <7f1jce$nt4$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x11.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Apr 14 15:54:47 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-04-14T00:00:00+00:00 List-Id: In article <7f1jce$nt4$1@nnrp1.dejanews.com>, czgrr wrote: > > > In article <7evbei$opm$1@nnrp1.dejanews.com>, > Robert Dewar wrote: > > This is in general quite wrong. Access to local variables > > on the stack is generally much more efficient than access > > to global variables on modern architectures. > At the end of this post I have included some code. The output I get is also > listed, and you can clearly see a difference between the two sets of procedure > calls, with the only code difference being a variable declared locally or > globally. I admit the local version is not of much use! Nifty. But my question had to do with the scope of subprograms, not vairables. For some reason the wisdom of reducing the scope of variables is unchallenged, but the same logic applied to subprograms seems to be in doubt. Personally I have other more philisophical reasons for avioding nesting subprograms. But occasionaly it is called for, and the effeciency argument seemed fascetious to me. I wanted to know if there is anything to it. -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own