🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #360

Re: Can you nest subroutines in C?

#360
From: Matt Dillon
Date: Wed, 05 Jul 1989 19:43
26 lines
1719 bytes
:>>        I do not understand why C does not support Nested routines.  Perhaps
:>>this will be added to the ANSI standard at some point in the future.
:>Probably the biggest thing against it is the fact that it makes compilers much
:>more difficult to write (especially modifying existing compilers).
:
:No. The reason why C does not support nested functions is that it is
:a _bad_ idea. The worst piece of impenetrable rubbish I have ever tried
:to understand was written by Wirth in Algorithms + Data = Programs and
:purported to handle B-trees. It was made impossible to understand by the
:_complexity_ of the scoping considerations. C scoping is not perfect, maybe,
:but nested functions would only make it worse.
:-- 
:Softway: +61 2 698 2322	     Andrew Gollan	adjg@softway.oz
:GPO Box 305, Strawberry				{uunet,mcvax}!softway.oz!adjg
:Hills NSW 2012					Fax: +61 2 699 9174

	Well, actually, I like subroutine nesting, but only if very, very
    restricted.  It would have been to allow it in C and even relatively
    trivial to implement if you disallow access to the sub-subroutines
    function pointer and scope it so only the subroutine containing the
    sub-subroutine can call it.

	I agree that it is an incredibly _bad_ idea if you make it too
    general (like most languages do).

					-Matt
Technical Details
Message-ID: <8907051943.AA04443@postgres.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!tut.cis.ohio-state.edu!ucbvax!POSTGRES.BERKELEY.EDU!dillon

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!tut.cis.ohio-state.edu!ucbvax!POSTGRES.BERKELEY.EDU!dillon
From: dillon@POSTGRES.BERKELEY.EDU (Matt Dillon)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Can you nest subroutines in C?
Message-ID: <8907051943.AA04443@postgres.Berkeley.EDU>
Date: 5 Jul 89 19:43:45 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 26