Re: Multiple return values

jamesl@netcom.com (James Logajan)
8 May 1997 21:07:10 -0400

          From comp.compilers

Related articles
[21 earlier articles]
Re: Multiple return values jch@hazel.pwd.hp.com (John Haxby) (1997-05-04)
Re: Multiple return values jan@digicomp.com (Jan Galkowski) (1997-05-04)
Re: Multiple return values gscase@interact.net.au (1997-05-04)
Re: Multiple return values Robert.Harley@inria.fr (1997-05-04)
Re: Multiple return values tim@franck.Princeton.EDU (1997-05-04)
Re: Multiple return values jens.hansson@mailbox.swipnet.se (1997-05-04)
Re: Multiple return values jamesl@netcom.com (1997-05-08)
Re: Multiple return values hbaker@netcom.com (1997-05-08)
Re: Multiple return values mark@omnifest.uwm.edu (1997-05-13)
Re: Multiple return values bear@sonic.net (Ray Dillinger) (1997-05-13)
Re: Multiple return values jan@fsnif.neuroinformatik.ruhr-uni-bochum.de (Jan Vorbrueggen) (1997-05-14)
Re: Multiple return values hbaker@netcom.com (1997-05-14)
Re: Multiple return values markt@harlequin.co.uk (Mark Tillotson) (1997-05-25)
[2 later articles]
| List of all articles for this month |
From: jamesl@netcom.com (James Logajan)
Newsgroups: comp.compilers,comp.lang.misc
Followup-To: comp.lang.misc
Date: 8 May 1997 21:07:10 -0400
Organization: Lugoj Incorporated
References: 97-04-091 97-04-112 97-04-135 97-05-045
Keywords: syntax, design

Tim Hollebeek (tim@franck.Princeton.EDU) wrote:
[Discussion on function returns and assignment]
: IMO, the ideal syntax is:


: f(a, b, c) -> (c, d)


I like that.


: though many people prefer assignment-type syntax. The advantage is
: that:


: f(a) -> a


: makes sense read left to right, while:


: a := f(a)


True, but you are more likely to see:
b = f(a)


: looks suspiciously recursive. Using '=' for assignment qualifies as
: "not even wrong", IMNSHO :-)


If left and/or right pointing arrow characters had been defined into
ASCII (and of course built into keyboards), using "=" for assignment
would have been "not even wrong." But these realities exist:


1) Assignment is the most frequently occuring operation in real programs.
2) There are no left/right arrows in 7-bit ascii.
3) High-frequency semantically "atomic" operations deserve their own
      characters (e.g. +, -, *, /; NOT "plus" "minus" etc unless you are
      talking COBOL).
4) While ":" might barely have worked, "=" has been hijacked for that
      purpose and few have lingering problems with the differing meanings.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.