7

Looking through the August 1979 issue of Byte magazine, it discusses a dialect of Lisp in which arithmetic operations are denoted by words like PLUS and TIMES.

Later dialects like Common Lisp and Scheme use the symbols common to other languages like + and *.

When did Lisp generally switch from one convention to the other?

4
  • 1
    Are you able to give more information about the dialect of Lisp you were just reading about? Mar 28, 2019 at 16:29
  • @Wilson It doesn't seem to say what the dialect is specifically called, or if it does, I missed it. The Byte issue can be downloaded in PDF if you want to take a look yourself.
    – rwallace
    Mar 29, 2019 at 4:37
  • 1
    Scheme is actually earlier than 1979. Scheme was first described in 1975 and had already + and *. Apr 2, 2019 at 7:09
  • If you could edit your question to give us the article title and page number (the issue is full of articles about various LISPs) that would be very helpful. You'd get bonus points for also giving a link to the page in that issue, like this, so that others can simply click it rather than paging through the issue themselves.
    – cjs
    Sep 21, 2019 at 7:53

2 Answers 2

5

All the various LISP 1.5 systems (on the IBM 7090 and otherwise) appears always to have used only PLUS, DIFFERENCE, MINUS (unary), etc. (§4.2 p.25) Its small derivative PDP-1 LISP (1964) also did as well (§2 p.3 Table 1, though I don't know what happened to DIFFERENCE.)

LISP 2, discussed extensively in the early '60s but never implemented, did use symbols for arithmetic in the ALGOL-like "source language," but I think you're not talking about this. The S-expression "internal language" still used PLUS etc. (See example of both in §5.2 on p.13.)

The BBN descendent, INTERLISP (also started on the PDP-1, but eventually moving to the PDP-10 amongst many other machines) was still using plus etc. in 1974, and had added iplus and friends to do faster integer arithmetic that avoided boxing the values where possible. (§13.1 p.13.2) This continued on through at least 1983. (§2.9.4 p.2.44)

The other direct descendant, Maclisp, through at least 1970 was the same, as far as names of numerical functions go. (No list of functions in this one, but see code on pp. 14, 20, 25, and 30.)

The Start of Symbols

However, by 1973, as well as using 'A as a shorter form of (QUOTE A) (which I think was first introduced in CONNIVER in 1972), Maclisp started using symbols for arithmetic functions. (§7.1.4). (This seems to have been part of the changes made during Moon's project to reimplement Maclisp on the Honeywell 6180 running MULTICS.) However, these were used for type-specific versions of the functions; plus etc. was still used for the generic versions. Here I quote from the published manual of 1974 because it's much easier to read.

Section 7 "Functions on Numbers" covers the numerical operations. From §7.2 "Comparison":

  • =         SUBR 2 args

    (= x y) is t if x and y are numerical equal. x and y must be both fixnums or both flonums.

...

  • greaterp         LSUBR 2 or more args

    greaterp compares its arguments, which must be numbers, from left to right. If any argument is not greater than the next, greaterp returns nil. But if the arguments to greaterp are strictly decreasing, the reault is t.

  • >         SUBR 2 args

    (> x y) is t if x is strictly greater than y and nil otherwise. x and y must be both fixnums or both flonums.

And from §7.4 "Arithmetic":

  • plus         LSUBR 0 or more args

    plus returns the sum of its arguments, which may be any kind of numbers. Conversions to flonum or bignum representation are done as needed. Flonum representation will be used if any of the arguments are flonums; otherwise fixnum representation will be used if the results can fit in fixnum form. If it cannot, bugnum representation will be used.

  • +         LSUBR 0 or more args

    + returns the sum of its arguments. The arguments must be fixnums, and the result is always a fixnum. Overflow is ignored.

Symbols Replace Words

The original paper on Scheme, AIM-349 "Scheme: An Interpreter for the Extended Lambda Calculus" (Sussman and Steele, December 1975)¹, uses symbols such as = and + for the EQUAL and PLUS functions, as you can immediately see from the first example in section 2, and there's no a mention of the word versions. This seems to be the first time that these were used for generic, rather than integer type-specific, functions and replaced, rather than augmenting, the word functions. This is not formally defined, however, nor is it in AIM-452 R¹RS. It's not until 1985, with the publication of AIM-848 R²RS (§II.6 p.39) that the numerical operations are specifically defined to be +, -, etc. and by that time of course Common LISP had already done this too.

If you want to dig around yourself for more information or try to find earlier examples, a good source of documentation for many, many versions of LISP is the Software Preservation Group's History of LISP page.


¹This is the first "Lambda Paper", and might also retroactively be called "R⁰RS."

15

Lisp is not a single language, but a whole ecosystem of different languages. Moreover, there's no standard covering all Lisps, like with C or Fortran, so for this reason, + and plus are equally "valid".

When Lisp 1 (March 1960) was written, the primitive operations defined were car, cdr, cons, and, or, cond, etc. The arithmetic operations were not primitives at that time, so the programmers chose their own names.

At least Lisp 1.5 (early 60s) had both.

But this Lisp from 1970 had PLUS and MINUS but no + nor -.

If you consider Scheme (1975) to be a Lisp, then it is a specimen having both + and &+ (the latter is an optimisation for two arguments only).

And Common Lisp (1984) has + but not plus as you have noted.

So I posit that we gradually settled on +-style symbols starting in the 70s, and the situation was a state of flux before then, for the reason that arithmetic operations were not even primitive operations to begin with.

6
  • 2
    Common Lisp does have a standard; in fact it was the first object-oriented language to get an ANSI standard.
    – sds
    Mar 28, 2019 at 16:18
  • 12
    @sds, That's right, but there's no standard that covers everything that I'd personally call Lisp. Mar 28, 2019 at 16:24
  • 3
    The way I read the LISP 1.0 doc, the arithmetic functions have to have alphanumeric names, since they're atoms, and atoms have names that are alphanumeric. Mar 28, 2019 at 22:04
  • 2
    Agree; but I meant "+ was not possible" rather than "PLUS is the only possibility". Mar 29, 2019 at 12:01
  • 1
    The Lisp I manual specified the functions SUM and PRDCT for float operations. It provides PLUS and TIMES for use in symbolic algebraic expressions. See the function SMPLFY. Apr 2, 2019 at 7:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .