1. 34

  2. 5

    “However, the computer they used to first implement LISP was missing square brackets, so everything was written in S-expression notation.”

    We’re often talking about design hold-overs of UNIX that came from hardware limitations. Here’s one for LISP I didn’t know about.

    1. 3

      It is replacing parentheses with square brackets that enables us to manuplate functions/procedures as lists with mechanisms like macros, etc. To quote SICP:

      The most significant of these features is the fact that Lisp descriptions of processes, called procedures, can themselves be represented and manipulated as Lisp data.

      So the significant feature of LISP is essentially, or at least started as, an implementation detail?

      EDIT: here is an apparent source of the claim:

      … The M-notation also used brackets instead of parentheses to enclose the arguments of functions in order to reserve parentheses for list-structure constants. It was intended to compile from some approximation to the M-notation, but the M-notation was never fully defined, because representing LISP functions by LISP lists became the dominant programming language when the interpreter later became available. A machine readable M-notation would have required redefinition, because the pencil-and-paper M-notation used characters unavailable on the IBM 026 key punch.

      1. 1

        FWIW, Mathematica IIRC is pretty much “what if Lisp used M-expressions instead?” explicitly.

    2. 4

      Is it only me, or isn’t the concept of an article discussing the power of lisp without mentioning macros a bit weird?

      1. 12

        I thought the opposite when I read it. This article shows just how powerful LISP is without its most powerful feature. And it’s good as an introduction to the power of LISP since macros can be hard to understand immediately, meanwhile this code is built up from very basic pieces into something very powerful.

        1. 2

          If you read R4RS (only 50 pages IIRC), it gives how derived expressions can be expressed in terms of primitive expressions (lit, var, call, lambda, if, set!). Such is what scheme’s claim of elegance and power. Macros are in the appendix of R4RS.

          1. 2

            Macros are a detail. Most of the trick lies in the first-class syntax for working with ASTs playing well together with eval.

            Racket is not using traditional macros, but rather another higher-level abstraction, but the concise syntax makes it great anyway.