Re: Lisp history: IF, etc.

Liste des GroupesRevenir à cl lisp 
Sujet : Re: Lisp history: IF, etc.
De : jshem (at) *nospam* yaxenu.org (Julieta Shem)
Groupes : comp.lang.lisp
Date : 04. Apr 2024, 01:30:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87jzleuird.fsf@tudado.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Alan Bawden <alan@csail.mit.edu> writes:

Kaz Kylheku <643-408-1753@kylheku.com> writes:
>
   On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
   > Lisp doesn't really have statements _because_ McCarthy invented the
   > conditional expression.  That's kind of the point.  Other programming
   > languages at the time (e.g. FORTRAN and ALGOL) only had conditional
   > statements.  McCarthy invented the conditional expression and thus
   > created the first expression-only programming language.
>
   However, conditional expressions ultimately come from math. E.g for
   specifying a discontinuous function:
>
      f(x) = { x, if x >= 0
             { 0, if x < 0
>
   If you think about it, it's actually kind of ignorant to invent a
   programming language with imperative if statements, but in which where
   the math conditional is missing.
>
If you think like a historian, you don't describe this as "ignorant".
It's just not something that was above the horizon in the mind set of
the time.  After all, that mathematical notation you are referring to
isn't something that mathematicians get very formal about.

So true.

It has a status that's midway between being able to define something
using a simple equation, and having to resort to a definition in the
form of a paragraph of words.  Realizing that you could tighten that
notation up and use it in a programming language _as a kind of
expression_ is actually a bit of a leap.

There's a paper from 1961--1963 in which he defines the conditional
expression with the intention of being able to define functions
recursively.

--8<---------------cut here---------------start------------->8---
  A BASIS FOR A MATHEMATICAL THEORY OF COMPUTATION
  JOHN McCARTHY
  1961--1963

  [This 1963 paper was included in Computer Programming and Formal Sys-
  tems, edited by P. Braffort and D. Hirshberg and published by
  North-Holland.  An earlier version was published in 1961 in the
  Proceedings of the Western Joint Computer Conference.]

  [...]

  The present paper is an attempt to create a basis for a mathematical
  theory of computation.  [...]

  [...]

  2.1 Functions Computable in Terms of Given Base Functions

  Suppose we are given a base collection F of functions (including
  predicates) having certain domains and ranges. [...] Our object is to
  define a class of functions C{F} which we shall call the class of
  functions computable in terms of F.  Before developing C{F} formally,
  we wish to give an example, and in order to give the example, we first
  need the concept of conditional expression. In our notation a
  conditional expression has the form

                  (p1 → e1, p2 → e2, . . . , pn → en)

  which corresponds to the ALGOL 60 reference language (12) expression

       if p1 then e1 else if p2 then e2 . . . else if pn then en.

  [...]

  Some examples of the conditional expressions for well known functions
  are |x| = (x < 0 → -x, x >= 0 → x) [...]

  Now we are ready to use conditional expressions to define functions
  recursively. For example, we have

                 n! = (n = 0 → 1, n =/= 0 → n · (n − 1)!)

  [...]
--8<---------------cut here---------------end--------------->8---

Date Sujet#  Auteur
2 Apr 24 * Lisp history: IF, etc.56Alan Bawden
2 Apr 24 +- Re: Lisp history: IF, etc.1Kaz Kylheku
3 Apr 24 +- Re: Lisp history: IF, etc.1Gijs Hillenius
3 Apr 24 +- Re: Lisp history: IF, etc.1Gijs Hillenius
3 Apr 24 +* Re: Lisp history: IF, etc.49Madhu
3 Apr 24 i`* Re: Lisp history: IF, etc.48Alan Bawden
3 Apr 24 i +* Re: Lisp history: IF, etc.35Paul Rubin
3 Apr 24 i i`* Re: Lisp history: IF, etc.34Alan Bawden
4 Apr 24 i i +* Re: Lisp history: IF, etc.32Paul Rubin
4 Apr 24 i i i+* Re: Lisp history: IF, etc.5Lawrence D'Oliveiro
4 Apr 24 i i ii+* Re: Lisp history: IF, etc.3Axel Reichert
4 Apr 24 i i iii+- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro
4 Apr 24 i i iii`- Re: Lisp history: IF, etc.1Paul Rubin
4 Apr 24 i i ii`- Re: Lisp history: IF, etc.1Kaz Kylheku
4 Apr 24 i i i`* Re: Lisp history: IF, etc.26Alan Bawden
5 Apr 24 i i i `* Re: Lisp history: IF, etc.25Paul Rubin
5 Apr 24 i i i  `* Re: Lisp history: IF, etc.24Julieta Shem
5 Apr 24 i i i   +- Re: Lisp history: IF, etc.1Julieta Shem
6 Apr 24 i i i   +- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro
15 Apr 24 i i i   `* Re: Lisp history: IF, etc.21Paul Rubin
16 Apr 24 i i i    `* Re: Lisp history: IF, etc.20Jeff Barnett
16 Apr 24 i i i     +* Re: Lisp history: IF, etc.2Lawrence D'Oliveiro
16 Apr 24 i i i     i`- Re: Lisp history: IF, etc.1Jeff Barnett
16 Apr 24 i i i     +* Re: Lisp history: IF, etc.16Paul Rubin
16 Apr 24 i i i     i`* Re: Lisp history: IF, etc.15Jeff Barnett
16 Apr 24 i i i     i `* Re: Lisp history: IF, etc.14Lawrence D'Oliveiro
16 Apr 24 i i i     i  +* Re: Lisp history: IF, etc.12Paul Rubin
17 Apr 24 i i i     i  i`* Re: Lisp history: IF, etc.11Lawrence D'Oliveiro
17 Apr 24 i i i     i  i `* Re: Lisp history: IF, etc.10Paul Rubin
17 Apr 24 i i i     i  i  `* Re: Lisp history: IF, etc.9Jeff Barnett
17 Apr 24 i i i     i  i   `* Re: Lisp history: IF, etc.8Lawrence D'Oliveiro
17 Apr 24 i i i     i  i    `* Re: Lisp history: IF, etc.7Paul Rubin
17 Apr 24 i i i     i  i     +* Re: Lisp history: IF, etc.3Madhu
18 Apr 24 i i i     i  i     i`* Re: Lisp history: IF, etc.2Lawrence D'Oliveiro
18 Apr 24 i i i     i  i     i `- Re: Lisp history: IF, etc.1Paul Rubin
17 Apr 24 i i i     i  i     `* Re: Lisp history: IF, etc.3Ben Bacarisse
18 Apr 24 i i i     i  i      `* Re: Lisp history: IF, etc.2Lawrence D'Oliveiro
18 Apr 24 i i i     i  i       `- Re: Lisp history: IF, etc.1Stefan Monnier
17 Apr 24 i i i     i  `- Re: Lisp history: IF, etc.1Jeff Barnett
17 Apr 24 i i i     `- Re: Lisp history: IF, etc.1Stefan Ram
4 Apr 24 i i `- Re: Lisp history: IF, etc.1Ben Bacarisse
3 Apr 24 i +* Re: Lisp history: IF, etc.7Kaz Kylheku
4 Apr 24 i i+* Re: Lisp history: IF, etc.5Alan Bawden
4 Apr 24 i ii+* Re: Lisp history: IF, etc.3Kaz Kylheku
4 Apr 24 i iii`* Re: Lisp history: IF, etc.2Kaz Kylheku
4 Apr 24 i iii `- on levels of disappointment (Was: Re: Lisp history: IF, etc.)1Julieta Shem
4 Apr 24 i ii`- Re: Lisp history: IF, etc.1Julieta Shem
5 Apr 24 i i`- Re: Lisp history: IF, etc.1Spiros Bousbouras
4 Apr 24 i +* Re: Lisp history: IF, etc.3Lawrence D'Oliveiro
4 Apr 24 i i`* Re: Lisp history: IF, etc.2Alan Bawden
4 Apr 24 i i `- Re: Lisp history: IF, etc.1Kaz Kylheku
12 Apr 24 i `* Re: Lisp history: IF, etc.2Alan Bawden
12 Apr 24 i  `- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro
4 Apr 24 `* Re: Lisp history: IF, etc.3Kaz Kylheku
4 Apr 24  `* Re: Lisp history: IF, etc.2Alan Bawden
4 Apr 24   `- Re: Lisp history: IF, etc.1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal