I'd like to find out how people tolerated parens back in the golden days of Lisp. I have a feeling we might've forgotten some things that would be useful today, or might influence some new ideas.
I started by working backwards from today (still filling in blanks):
- 2015 - Parinfer
- 2014 - Lispy
- 2012 - Smartparens
- 2005 - Paredit by Taylor Campbell
- 2001 - DrScheme, now DrRacket
- ...
- 1987 - Interlisp SEdit (structure editor. full interactive display)
- 198? - Interlisp DEdit (display editor. clickable display + command window)
- 1980 - Zmacs - first structure commands for text editor
- ...
- 1970 - BBN (InterLisp) - ("on-line" structure editor. REPL-based editor)
- 1966 - PILOT - first thesis on structure editing
In Interlisp, the programmer worked with source code presented by a structure editor, which operated on source code in the form of memory-resident Lisp data structures.
—Evolution of Lisp
A command-line interface for editing s-expressions. Rather than displaying the whole file, only one expression is displayed at a time—by printing after each command.
- use
Nto go Nth child of current expression - use
0to go up to parent - nested sub-expressions collapsed by default to
& - expand with
? - pretty-print with
pp
Six paren commands can be performed on the current expression's children:
| Command | Name | Mnemonic | Extra Inference |
|---|---|---|---|
BI | Both In | ()+ | |
BO | Both Out | ()- | |
LI | Left In | (+ | adds ) at end |
LO | Left Out | (- | removes ) and EVERYTHING AFTER IT |
RI | Right In | )< | |
RO | Right Out | )> |
(A B C D E F G H) >(BI 3) (A B (C) D E F G H) ^ ^ wrap parens around index 3 (A B C D E F G H) >(BI 3 5) (A B (C D E) F G H) ^ ^ wrap parens from index 3 to index 5 >(BO 3) (A B _C D E_ F G H) ^ ^ unwrap parens around index 3 (A B C D E F G H) >(LI 3) (A B (C D E F G H)) ^ ^ insert left-paren before index 3, and right-paren at end (A B (C D E) F G H) >(LO 3) (A B _C D E_ _ _ _) ^ ^ ^ ^ ^ remove parens around index 3, and EVERYTHING AFTER IT (A B (C D E F G H)) >(RI 3 2) (A B (C D) E F G H_) ^ <----- ^ move right-paren of index 3 to inner index 2 >(RO 3) (A B (C D_ E F G H)) ^ -----> ^ move right-paren of index 3 to end See the 1983 Interlisp Reference Manual, Chapter 17. "Commands That Move Parentheses" on page 465.
The display editor was a visual alternative to the teletype editor—click one or two expressions in the pretty-print, then click a command to execute on those expressions.
- pretty-print window (left) - click to select expressions (current=solid-lined, previous=dash-lined)
- command menu (right) - click to perform an operation on selections (current=arg1, previous=arg2)
- type-in window (below) - manually type an expression. when done, it becomes selected and clickable
Clicking an expression while holding Shift unreads it into the type-in window (pastes as text).
- left click - select object
- middle click - select containing list
- right click - select lowest common ancestor with previous selection
| DEdit Paren Command | Initially Hidden? | Teletype Command |
|---|---|---|
() | same as BI | |
( in | middle-click () to show | same as LI |
) in | middle-click () to show | same as RI |
() out | same as BO | |
( out | middle-click () out to show | same as LO |
) out | middle-click () out to show | same as RO |
See the 1985 Interlisp-D Reference Manual Volume II: Environment, Chapter 16 page 407.
from the 1987 Xerox Lisp Medley Release Notes:
SEdit is the new Xerox Lisp structure editor. It allows you to edit Xerox Lisp code directly in memory. This editor replaces DEdit in Chapter 16, Structure Editor, of the Interlisp-D Reference Manual. First introduced in Lyric, the SEdit structure editor has been greatly enhanced in the Medley release.
Two types of carets (cursors):
⌃edit caret (set with left-click)▲structure caret (set with middle-click)
(LEQ n 1) ; 1. left-click "Q" ─⌃ (LEQ n 1) ; 2. middle-click "Q" ───▲ (LEQ n 1) ; 3. middle-click "Q" again ─────────▲ (LEQ n 1) ; 1. left-click "E" ─⌃ ┌──┐ (L│EQ│ n 1) ; 2. right-click "Q" └──┘ (LEQ n 1) ; 1. middle-click "E" ───▲ ┌───────┐ (│LEQ n 1│) ; 2. right-click "1" └───────┘ - gaps
- broken atoms
- special characters
Notes:
- See Appendix B of Lyric Release Notes or Medley Release Notes
- musings on SEdit
ZMacs in 1980 is reported to be the first text editor with balanced parentheses commands. The 1987 ZMacs Editor Reference shows them on page 209 (3-137):
I must say that I wish I could use LISP/VM again, and Martin's editor. I've always felt it gave me the best interface, with the highest productivity, of any editor I've ever used for LISP. (source: https://groups.google.com/d/msg/comp.lang.lisp/D2Q5t8IEOkg/EjgB3XBP8hQJ)
In the 1984 LISP/VM User's Guide
...
(preferred formatted ASCII files over data structures for programs)
A discussion/debate from 1978 that reveals a lot about how people thought about text vs structure when storing and displaying their code:
Programming in an Interactive Environment: the Lisp Experience
- response by Richard Stallman arguing for text: https://www.deepdyve.com/lp/association-for-computing-machinery/surveyor-s-forum-structured-editing-with-a-lisp-PzoXAz9GCu?impressionId=594bfe8baf9dc&i_medium=mydeepdyve&i_campaign=recommendations&i_source=recommendations
- author's reply: https://www.deepdyve.com/lp/association-for-computing-machinery/surveyor-s-forum-structured-editing-with-a-lisp-mQNqMU2je0?impressionId=594c0f05171ea&i_medium=docview&i_campaign=recommendations&i_source=recommendations
- a much later followup discussing how structured editing died: https://groups.google.com/forum/#!msg/comp.lang.lisp/D2Q5t8IEOkg/AqbNfOxZgUIJ
- Maclisp killed it because they wanted custom layout of code and comments
This is so far my favorite summary of this topic from 1997. (too many great points to list). https://groups.google.com/d/msg/comp.lang.lisp/dldLx8Yj7q8/u4y2zq19XIYJ
- Prune: https://www.facebook.com/notes/kent-beck/prune-a-code-editor-that-is-not-a-text-editor/1012061842160013/
- Frame-based editing: https://news.ycombinator.com/item?id=14609215
- Intentional Programming: https://www.youtube.com/watch?v=tSnnfUj1XCQ
- similar to Interlisp (i.e. structure-based)
started from Paredit credits, (could not locate sedit.el):
The original inspirations for paredit were Interlisp-D's structure editor 'SEdit' -- a real structure editor, not a cheesy imitation like paredit -- and Guillaume Germain's sedit.el for GNU Emacs.
- finding mailing list discussions
- looking for official reference manuals of lisp machines
- using deepdyve to find articles
- asking around
General:
- Evolution of Lisp seems to provide a good map.
- http://www.softwarepreservation.org/projects/LISP/

