Map
Index
Random
Help
Topics
th

Topic: return from procedure

topics > computer science > programming > Group: program control



Group:
function

Topic:
co-routines
Topic:
continuation
Topic:
exception handling by termination
Topic:
function call
Topic:
function results
Topic:
save-restore
Topic:
termination of control unit

Summary

A return-to-caller is explicitly specified, or implicitly executed at procedure termination. With value-returning functions the return may specify the returned value, or a local variable may be the returned value. A return reverts the embedded context to its previous environment. The return may be through multiple levels in exception handling or it can be to the original caller of a recursive procedure. (cbb 5/80)
Subtopic: continuation up

Quote: in SL5, 'return r to e' suspends environment, resumes environment e with value r; prior resumer of e unchanged [»hansDR5_1978]

Subtopic: tail-call up

Quote: a C-- procedure may tail-call another procedure; deallocates the activation record and other resources [»ramsN6_2000]
Quote: C-- includes an efficient switch statement; e.g., jump table of procedure addresses for a tail call [»joneSP9_1999]

Subtopic: throwing exception or signal up

Quote: the header of a CLU procedure specifies how it can terminate; i.e., its signals and return results [»liskBH11_1979]
Quote: a CLU procedure can either return or signal an exceptional condition; both can provide result objects
Quote: exception handling by stack cutting w/o restore, table-driven stack unwinding, stack unwinding via code, and continuation-passing via code [»ramsN6_2000]
Quote: model an exception handler as a C-- continuation; like a label with parameters; a non-local exit via 'cut to' [»ramsN6_2000]

Subtopic: recursive exit up

Quote: Madcap 6 includes a 'nestexit' to exit from all nested recursive calls [»morrJH8_1972]

Subtopic: examples up

Quote: 'leave(p,v)' terminates most recent activation of p and returns v as its value
[»thimH2_1980]

Related Topics up

Group: function   (12 topics, 232 quotes)

Topic: co-routines (13 items)
Topic: continuation (16 items)
Topic: exception handling by termination (16 items)
Topic: function call (28 items)
Topic: function results (7 items)
Topic: save-restore (4 items)
Topic: termination of control unit
(22 items)


Updated barberCB 1/05
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.