Skip to content

Instantly share code, notes, and snippets.

(* https://dl.acm.org/doi/10.1145/3720507 *)
module Syntax = struct
type id = string
type producer_id = id
type consumer_id = id
type constructor_id = id
type deconstructor_id = id
type type_id = id
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{simplebnf}
\def\colon{:}
\def\tyvar{\alpha}
\def\clsname{C}
\def\method{m}

Two Lisp History Stories

prog

Lisp, thanks to Scheme, is often associated with functional programming. However, as David Turner points out,

McCarthy (1978) records that LISP had assignment and goto before it had conditional expressions and recursion—it started as a version of FORTRAN I to which these latter were added.

LISP was not based on the lambda calculus, despite using the word “LAMBDA” to denote functions. At the time he invented LISP, McCarthy was aware of (Church 1941) but had not studied it. The theoretical model behind LISP was Kleene's theory of first order recursive functions [according a talk McCarthy gave, heard by Turner].

@texdraft
texdraft / CPS.rkt
Last active December 22, 2025 11:54
CPS conversion from Danvy and Filinksi's “Abstracting Control”
#lang racket
(struct Constant (value))
(struct Variable (name))
(struct Apply (function argument))
(struct Lambda (variable body))
(struct If (test then else))
(struct Reset (body))
(struct Shift (variable body))
(struct Call-With-Current-Continuation (function))
(defpackage :LISP-1.5-compiler
(:use :Common-Lisp)
(:shadow :length ; defined by the compiler
:reverse ; defined by the compiler
:member ; defined by the compiler
:map ; like mapl, and function is first argument
:exp ; used as special variable in the compiler
:compile ; defined by the compiler
:maplist ; takes function first
:mapcon ; takes function first
@texdraft
texdraft / listing.txt
Created March 11, 2021 19:20
CONGEN listing
LINE HAS BEEN TRUNCATED TO 72 COLUMNS
LINE HAS BEEN TRUNCATED TO 72 COLUMNS
←Entry: MAIN→
__________________________________________________________________________
(defconstant character-patterns
(quote ((#\Newline . #*000000000000)
(#\Space . #*000000000000)
(#\0 . #*001000000000)
(#\1 . #*000100000000)
(#\2 . #*000010000000)
(#\3 . #*000001000000)
(#\4 . #*000000100000)
(#\5 . #*000000010000)
(#\6 . #*000000001000)
________________________________________________________________________
/* M948-1207 LEVIN,LISP,TEST,2,3,250,0 |
| * * * * |
|* * * * * * * |
|000000000*0000*00*00*0**0***0*0*00***00000000000000000000000000000000000|
|1111111*1111111111111111111111111111111111111111111111111111111111111111|
|22222222*22222222222*2222*22*222*222222222222222222222222222222222222222|
|333333333333*3333**333**33**3***333*333333333333333333333333333333333333|
|*4*4*4444444444444444444444444444444444444444444444444444444444444444444|
|5555555555555**5*5555555*55555555*55555555555555555555555555555555555555|
program tangle(web_file, change_file, Pascal_file, pool);
label
end_of_TANGLE;
const
buf_size = 100;
max_bytes = 45000;
max_toks = 50000;
max_names = 4000;
max_texts = 2000;
hash_size = 353;
@texdraft
texdraft / texs.diff
Created August 13, 2019 19:21
diff oldtex.web tex.web
This file has been truncated, but you can view the full file.
2,4c2,3
< \def\glob{13} % this should be the section number of "<Globals...>"
< \def\gglob{20, 26} % this should be the next two sections of "<Globals...>"
< This is \TeX, a document compiler intended to produce high-quality typesetting.
---
> This is \TeX, a document compiler intended to produce typesetting of high
> quality.
9c8
< will be obtainable on a great variety of different computers.