Article View: comp.lang.misc
Article #4413Re: GOTO controversy
From: John E. Howland
Date: Fri, 22 Mar 1996 19:54
Date: Fri, 22 Mar 1996 19:54
35 lines
1389 bytes
1389 bytes
Scott Hawley (shawley@connix.com) wrote:
> What to you think? Loops without using loops?
> a loop:
> for(i=0;i<10;i++)
> {
> stuff
> }
> Looping with out a loop
> no_loop(0,10);
> no_loop(int start, int end)
> {
> if(start != end) {
> stuff
> no_loop(start+1,end);
> }
> }
This is how iteration is done in Scheme. The above example
is tail-recursive. In such cases, Scheme systems optimize
this to iterative code.
> I haven't tested this but you get the idea.
--
________________________________________________________________
John E. Howland url: http://www.cs.trinity.edu/~jhowland/
Computer Science email: jhowland@ariel.cs.trinity.edu
Trinity University voice: (210) 736-7480
715 Stadium Drive fax: (210) 736-7477
San Antonio, Texas 78212-7200
Technical Details
Message-ID:
<4iv0hl$1pg@neptune.cs.trinity.edu>Path:
arc1-ca.pugleaf.net!neptune.cs.trinity.edu!jhowlandReferences:
<314FB5F5.259B@simi.is> <3151B47F.70FD@connix.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!neptune.cs.trinity.edu!jhowland From: jhowland@ariel.cs.trinity.edu (John E. Howland) Newsgroups: comp.lang.misc,comp.lang.c,comp.lang.pl1,comp.lang.apl Subject: Re: GOTO controversy Followup-To: comp.lang.misc,comp.lang.c,comp.lang.pl1,comp.lang.apl Date: 22 Mar 1996 19:54:28 GMT Organization: Computer Science Department, Trinity University Message-ID: <4iv0hl$1pg@neptune.cs.trinity.edu> References: <314FB5F5.259B@simi.is> <3151B47F.70FD@connix.com> NNTP-Posting-Host: ariel.cs.trinity.edu X-Newsreader: TIN [version 1.2 PL2]