Abstract Heresies
Unorthodox opinions on computer science and programming.
Monday, August 30, 2021
Tail recursion and fold-left
›
fold-left has this basic recursion: (fold-left f init ()) = init (fold-left f init (a . d)) = (fold-left f (f init a) d) A straightfo...
4 comments:
Friday, August 27, 2021
A Floating-point Problem
›
Here's a 2x2 matrix: [64919121 -159018721] [41869520.5 -102558961] We can multiply it by a 2 element vector like this: (defun mxv (a b...
2 comments:
Wednesday, August 18, 2021
Fold right
›
fold-left takes arguments like this: (fold-left function init list ) and computes * (fold-left (lambda (l r) `(f ,l ,r)) 'init ...
8 comments:
Friday, May 21, 2021
Stupid Y operator tricks
›
Here is the delta function: δ = (lambda (f) (f f)) . Delta takes a function and tail calls that function on itself. What happens if we...
1 comment:
Saturday, May 15, 2021
β-conversion
›
If you have an expression that is an application, and the operator of the application is a lambda expression, then you can β-reduce the ...
Monday, May 10, 2021
Substitution
›
In McCarthy's early papers on Lisp, he notes that he needs a modified version of subst which needs to be aware of quoted expressions (...
1 comment:
Monday, May 3, 2021
Lightweight table
›
You don't need a data structure to make a lookup table. You can make a table just out of the lookup function. In this example, we ...
‹
›
Home
View web version