[Haskell-cafe] Alternative name for return

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu Aug 8 02:59:14 CEST 2013


On 8/08/2013, at 2:56 AM, Donn Cave wrote:
> The RFC822 headers of your email suggest that you use a Macintosh computer,
> so apart from the apparently disputable question of whether you're familiar
> with English, you have the same online dictionary as mine.

My department has an electronic subscription to the OED.

> Second definition:
> "give, put, or send (something) back to a place or person", with examples
> "she returned his kiss", usage from tennis and football, verdicts, etc.
> Third definition:  "yield or make a profit", fourth (re)elect a person or party.
> "Return" is all about providing a value, in English.

Check the OED.  Most of its meaning are about _turning back_,
_resuming_, _reverting_.  Yielding or making a profit is not at
all about "providing a value", but about money going out AND
COMING BACK.  It's the coming back part that makes it a "return".

"value" occurs twice in OED 'return, v.1", in neither case
referring to providing a value.
OED "re-turn, v.2" has "value" once, again not referring to
providing a value (in fact, to detecting possible theft).
OED "return, n" has "the fact or an instance of bringing value
in exchange for effort or investment", where the salient part
is "IN EXCHANGE FOR":  effort going out, value COMING BACK.
There are two other similar senses, out of I don't know how
many senses (because I lost count after 80).

A "return" can be "a reply, answer or retort" (as in the Fool's
"Marry, it was a sharp retort" in one of the Discworld novels,
when an alchemist's vessel exploded), "a summary of a [cricket]
play's bowling or batting performance", "a response to a demand",
"a wing or side of a building", or "a side street", among many
other things.

In all of the senses, the underlying idea is not provision of a
value, but going, turning, or bending back.

> When a term like "return" is used in a computer programming language in
> a sense that confounds any prior expectation based on English or other
> programming languages, that's the opposite of "intuitive".

OK, so when in the past someone met "RETURN" in their second programming
language, what had their experience taught them to expect?

ISO/IEC 1989:20xx CD 1.2 (E)

    14.9.32 RETURN statement

    The RETURN statement obtains either sorted records from the final
    phase of a sort operation or merged records during a merge operation.

    14.9.32.1 General format

    RETURN file-name-1 RECORD [ INTO identifier-1 ]
       AT END imperative-statement-1
    [ NOT AT END imperative-statement-2 ]
  [ END-RETURN ]

This is a somewhat more elaborate form of a statement which has been
present in COBOL since at least 1974 and probably longer.  The latest
estimate I've seen is that four thousand million lines of new COBOL
are added every year.

Operationally, the COBOL RETURN statement is more like a READ than
anything else.







More information about the Haskell-Cafe mailing list