Xref: utzoo comp.edu:3695 uw.general:1948 Path: utzoo!attcan!uunet!ogicse!milton!Tomobiki-Cho!mrc From: mrc@Tomobiki-Cho.CAC.Washington.EDU (Mark Crispin) Newsgroups: comp.edu,uw.general Subject: Re: Recursion Summary Message-ID: <9896@milton.u.washington.edu> Date: 25 Oct 90 05:58:00 GMT References: <1990Oct23.211651.10227@contact.uucp> <9868@milton.u.washington.edu> <9882@milton.u.washington.edu> <9892@milton.u.washington.edu> Sender: news@milton.u.washington.edu Distribution: na Organization: Mendou Zaibatsu, Tomobiki-Cho, Butsumetsu-Shi Lines: 41 In article <9892@milton.u.washington.edu> wiml@milton.u.washington.edu (William Lewis) writes: > But the CPU itself is iterative, not recursive. The CALL instruction >finishes when the subroutine begins, not when it ends. That is a wierd definition of iterative vs. recursion, although it may be what Computer Science classes are teaching these days. What if the "subroutine call" is a trap instruction, or an instruction that is implemented in hardware on some CPU models, in microcode on others, and in macrocode on others? By your argument there is no such thing as recursion. The notion that high-level languages are any difference from machine language can be disproved by the following C program: int foo (int n); main () { printf ("%d\n",foo (10)); return 0; } foo (int n) { _exit (0); return n; } The call to each of main(), printf(), and foo() is finished as soon as the stack frame is established. A separate return, whether explicit or implicit, is needed to unwind the stack and resume processing at the caller. _____ | ____ ___|___ /__ Mark ("Gaijin") Crispin "Gaijin! Gaijin!" _|_|_ -|- || __|__ / / R90/6 pilot, DoD #0105 "Gaijin ha doko?" |_|_|_| |\-++- |===| / / Atheist & Proud "Niichan ha gaijin." --|-- /| |||| |___| /\ (206) 842-2385/543-5762 "Chigau. Gaijin ja nai. /|\ | |/\| _______ / \ MRC@CAC.Washington.EDU Omae ha gaijin darou" / | \ | |__| / \ / \"Iie, boku ha nihonjin." "Souka. Yappari gaijin!" Hee, dakedo UNIX nanka wo tsukatte, umaku ikanaku temo shiranai yo.