🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Can you nest subroutines in C?

#208
From: Dave Haynie
Date: Tue, 27 Jun 1989 20:38
28 lines
1913 bytes
in article <4470@crash.cts.com>, wade@pnet01.cts.com (Wade Bickel) says:

>     Recently I switched from Benchmark Modula-2 to Lattice C.  While
> writing a piece of code I discovered, much to my dismay, that I could
> not express nested subroutines without choking the compiler.  Perhaps
> someone can enlighten me as to how to do this.

Why did you switch?  Something Lattice C does that cannot be performed in
Modula-2, code efficiency or just for fun?  

C doesn't support nested subroutines, unlike M2 or Pascal.  You can get 
the effect of "local-global" variables, and probably the speed as well,
by building a structure that gets passed to every function in the logical
group and using registerized parameters in Lattice V5.02.  C++ give you 
this effect even more so, though if you're at all used to the speed of
Benchmark compiles, you'll probably choke on how long it'll take to go
through a Lattice C++ compilation (still, I like the language).  Also, 
there's no source level debugger for Lattice C++ yet, while I just got a
look at the new Source Level Debugger for Benchmark M2, and I like it
better overall than Manx's SDB or Lattice's CodePRobe.  TINAR, of course...

> UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!wade
> ARPA: crash!pnet01!wade@nosc.mil
> INET: wade@pnet01.cts.com
-- 
Dave Haynie Commodore-Amiga (Systems Engineering) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: D-DAVE H     BIX: hazy
           Be careful what you wish for -- you just might get it
Technical Details
Message-ID: <7149@cbmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!amiga!cbmvax!daveh
References: <4470@crash.cts.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!amiga!cbmvax!daveh
From: daveh@cbmvax.UUCP (Dave Haynie)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Can you nest subroutines in C?
Message-ID: <7149@cbmvax.UUCP>
Date: 27 Jun 89 20:38:29 GMT
References: <4470@crash.cts.com>
Organization: Commodore Technology, West Chester, PA
Lines: 28