Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ima!inmet!ada-uts!richw From: richw@ada-uts Newsgroups: net.lang Subject: Re: Multiple assignments [long, but Message-ID: <15100026@ada-uts> Date: Mon, 2-Jun-86 21:22:00 EDT Article-I.D.: ada-uts.15100026 Posted: Mon Jun 2 21:22:00 1986 Date-Received: Mon, 9-Jun-86 01:16:10 EDT References: <1674@umcp-cs.UUCP> Lines: 22 Nf-ID: #R:umcp-cs.UUCP:1674:ada-uts:15100026:000:705 Nf-From: ada-uts!richw Jun 2 21:22:00 1986 CLU supports multiple assignment to some extent. For instance, you can use the following to swap the values of two variables: x, y := y, x You can even define procedures which return more than one result. As an example header, you could define a procedure to return the numerator and the denominator (after reduction) for a fraction: components = proc (f : Fraction) returns (int, int) However, CLU limits the use of such a procedure. Although you can "catch" the results using assignment: n, d := Fraction$components(f) you can't use both results as procedure arguments in one call: sum := Int$add(Fraction$components(f)) % Nope ! (note that %'s introduce comments in CLU).