Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!nuchat!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Re: Can you nest subroutines in C? Message-ID: <3982@sugar.hackercorp.com> Date: 4 Jul 89 02:10:03 GMT References: <4525@crash.cts.com> Organization: Sugar Land Unix - Houston Lines: 26 In article <4525@crash.cts.com>, wade@pnet01.cts.com (Wade Bickel) writes: > Pre-initialization is a nicety, not allowed in M2 because there is no way to > type the data. This is a restriction that I understand will be/has been > lifted. However, pre-initailization is not a conceptual tool. It can always > be translated to a series of assignments, or a number of other methods can > be used to init data. And nested procedures can be implemented by explicitly passing the frame pointer. In fact, you can implement nested procedures efficiently in 'C', whereas you can't implement pre-initialisation efficiently in Modula. And how about fall-throughs in switch statements? > As I said before, what bothers me most about this is that I can see no > reason why C does not support this feature. Because it requires that you implement displays, adding considerably to the complexity and overhead of the generated code, for a capability that can be implemented by hand. Asking why C doesn't implement nested procedures is like asking why Modula doesn't implement multiple inheritance. It's outside the scope of the language. -- Peter "Have you hugged your wolf today" da Silva `-_-' ...texbell!sugar!peter, or peter@sugar.hackercorp.com 'U`