3 ms·
One interesting feature of the Lisp microprocessor is that it doesn't have an ALU. At that time an ALU was a very large part of a processor design and the idea
by jecel 6y ago
One interesting feature of the Lisp microprocessor is that it doesn't have an ALU. At that time an ALU was a very large part of a processor design and the idea was that Lisp didn't need it and not having one would allow the project to fit (barely) in the limited area allocated to each student.
You can define numbers from scratch in Lisp by using lists and having their length (for example) represent the number's magnitude.
If we define the empty list as ZERO, and the successor of a number N as (CONS 'S N) we can build a whole math library from there:
(DEFINE ADD '(LAMBDA (A B)
(COND
((NIL? A) B)
((NIL? B) A)
(T (ADD (CONS 'S A) (CDR B)))
)))