comp.lang.ada
 help / color / mirror / Atom feed
From: davidf@mks.com (David J. Fiander)
Subject: Re: Help.  Procedure is undefined
Date: 1998/01/08
Date: 1998-01-08T00:00:00+00:00	[thread overview]
Message-ID: <ug1myg4jq.fsf@davidf-nt.mks.com> (raw)
In-Reply-To: 34b4f3da.7353367@news.logica.co.uk


reply-address-in-sig (Steve Garriga) writes:
> 
> From a glance at your code it seems that you don't understand control
> flow. When a procedure or function is called, control is passed with
> the intention that control is passed back when the procedure or
> function completes. 
> 
> So.... what you need if I understand your intention, is a loop in your
> main procedure which is terminated by selecting quit, and your other
> procedures to just 'return' (i.e. don't attempt to call main, just
> complete).

Infering backwards from your response, the other possibility is
that he's Scheme or Lisp programmer who thinks that the correct
way to implement a looping construct is via tail-recursive
function calls.  In Scheme, the pair of functions

	(define a (x) (printf "%d\n" x) (b x))

	(define b (x) (a (+ 1 x)))

will count forever, without ever blowing the stack (ignoring the
lack of a real "printf" function, of course).

- David




  reply	other threads:[~1998-01-08  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-08  0:00 Help. Procedure is undefined GJW3
1998-01-08  0:00 ` reply-address-in-sig
1998-01-08  0:00   ` David J. Fiander [this message]
1998-01-10  0:00 ` Hartmut H. Schaefer
1998-01-10  0:00   ` Nick Roberts
1998-01-12  0:00 ` John English
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox