• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A categorical programming language


Commit MetaInfo

Revision94316419d77d60a26f67487754df350dfc1a0290 (tree)
Time2024-06-30 10:09:30
AuthorCorbin <cds@corb...>
CommiterCorbin

Log Message

Add a sort of Maxwell's-laws presentation.

I don't personally put much stock in this sort of thing, but Alan Kay
and Douglas Crockford think it's essential.

Change Summary

Incremental Difference

--- /dev/null
+++ b/cammy-in-scheme.scm
@@ -0,0 +1,13 @@
1+(define (id x) x) (define ((comp f g) x) (g (f x))) (define (ignore _) '1)
2+(define ((pair f g) x) (cons (f x) (g x))) (define fst car) (define snd cdr)
3+(define ((cas f g) x) ((if (car x) f g) (cdr x)))
4+(define (left x) (cons #t x)) (define ((right x)) (cons #f x))
5+(define (t _) #t) (define (f _) #f) (define (either b) (cons b '1))
6+(define (conj x) (and (car x) (cdr x))) (define (disj x) (or (car x) (cdr x)))
7+(define (((curry f) x) y) (f (cons x y)))
8+(define ((uncurry f) p) ((f (car p)) (cdr p)))
9+(define (zero _) 0) (define (succ x) (+ 1 x))
10+(define ((pr x f) n) (if (zero? n) (x '1) (f ((pr x f) (- n 1)))))
11+(define (nil _) '()) (define con id)
12+(define ((fold x f) l)
13+ (if (null? l) (x '1) (f (cons (car l) ((fold x f) (cdr l))))))