Path: utzoo!mnetor!uunet!husc6!hao!boulder!michael@boulder.Colorado.EDU From: michael@boulder.Colorado.EDU (Michael Schmidt) Newsgroups: comp.lang.misc Subject: Re: Var scoping in Wirth-type languages (was: Poor Algorithms) Message-ID: <4760@sigi.Colorado.EDU> Date: 10 Mar 88 16:51:42 GMT References: <3821@ihlpf.ATT.COM> <2791@enea.se> <3949@ihlpf.ATT.COM> Sender: news@sigi.Colorado.EDU Reply-To: michael@boulder.Colorado.EDU (Michael Schmidt) Organization: Uni-GH Paderborn, FB17/Informatik Lines: 12 In-reply-to: nevin1@ihlpf.ATT.COM (00704a-Liber) Posting-Front-End: Gnews 1.1 In article <3949@ihlpf.ATT.COM>, nevin1@ihlpf (00704a-Liber) writes: > If some vars are declared 'globally' (at the topmost level), it is very > inefficient to access those variables in a procedure declared more than 1 > or 2 levels deep. There is a way to implement scoping that alleviates this > inefficiency, however. I think the most UN*X compilers do it rather efficient. The global variables are allocated in the bss (or data) segment. So the access to global *and* local variables doesn't require to follow the static chain. Michael Schmidt