LISP 1
1 program
Added 2026-03-12T10:15:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: Lisp I, LISP I
Provenance: commit 6c517ed015 · authored 2026-03-12T23:54:17+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Symbolic Differentiation
Provenance: commit 6c517ed015 · authored 2026-03-12T23:54:17+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
; LISP 1 - Symbolic differentiation
; Based on McCarthy's 1960 paper "Recursive Functions of Symbolic Expressions"
; Originally implemented on the IBM 704, 1960
;
; diff[e; x] differentiates expression e with respect to x
; M-expression form (from the paper):
; diff[e; x] = [atom[e] -> [eq[e; x] -> 1; T -> 0];
; eq[car[e]; PLUS] -> list[PLUS; diff[cadr[e]; x]; diff[caddr[e]; x]];
; eq[car[e]; TIMES] -> list[PLUS;
; list[TIMES; cadr[e]; diff[caddr[e]; x]];
; list[TIMES; diff[cadr[e]; x]; caddr[e]]];
; T -> UNDEFINED]
((LABEL DIFF
(LAMBDA (E X)
(COND
((ATOM E)
(COND ((EQ E X) (QUOTE 1))
(T (QUOTE 0))))
((EQ (CAR E) (QUOTE PLUS))
(LIST (QUOTE PLUS)
(DIFF (CADR E) X)
(DIFF (CADDR E) X)))
((EQ (CAR E) (QUOTE TIMES))
(LIST (QUOTE PLUS)
(LIST (QUOTE TIMES) (CADR E) (DIFF (CADDR E) X))
(LIST (QUOTE TIMES) (DIFF (CADR E) X) (CADDR E))))
(T (QUOTE UNDEFINED)))))
(QUOTE (PLUS (TIMES X X) X))
(QUOTE X))