Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!gitpyr!dsking From: dsking@pyr.gatech.EDU ( David King) Newsgroups: comp.sys.amiga.tech Subject: Re: Can you nest subroutines in C? Message-ID: <8674@pyr.gatech.EDU> Date: 5 Jul 89 03:08:12 GMT References: <4525@crash.cts.com> <3982@sugar.hackercorp.com> Reply-To: dsking@pyr.UUCP ( David King) Organization: Georgia Institute of Technology Lines: 37 In article <3982@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes: >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. > Actually its not that hard (famous last words). Of course it would be an extension to Modula-2 rather than the AI to find the first assignment. I do know of some Modula-2 vendors that are planning on doing this and the OSI M2 committee may also be discussing this (I don't keep up with these committees, takes a lot of time). >And how about fall-throughs in switch statements? What about them? Yes, they are more efficient than the M2 way of doing it but at the price of more confusion. Through some hackery you could get it close to the same efficiency. >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. Which is why language wars are silly. I actually had a friend who tried arguing that all system hacking should/could be done in APL. When pressed, he finally explained that he was talking about interfacing to assembly. :-) -David >-- >Peter "Have you hugged your wolf today" da Silva `-_-' >...texbell!sugar!peter, or peter@sugar.hackercorp.com 'U` -- David King - FROM Disclaimers IMPORT Standard; Georgia Insitute of Technology, Atlanta Georgia, 30332 uucp: ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!dsking ARPA: dsking@pyr.gatech.edu