duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
; Minimal "object oriented" scaffolding | |
(define (object methods) | |
(lambda (label method-parameters) | |
((cdr (assoc label methods)) method-parameters))) | |
; declaration: easily do funkier state stuff here | |
(define (person name dob) | |
(object `( (name . ,(lambda () name)) | |
(age . ,(lambda (today) (- today dob)))))) ; absolute nonsense, but an example of param passing |
find . -iname .git | xargs -I % sh -c 'cd %/..; pwd; git stash list | sed "s/^/ /"' |
I want to have a list of the cartoons/films that I watched as a child. I have flashbacks of themetunes and images, but can't always work out what they are.
Updates will add more shows, and screenshots/youtube links if possible
I hereby claim:
To claim this, I am signing this object:
module LittleLang where | |
open import Data.Bool | |
open import Data.Nat | |
data type : Set where | |
tNat tBool : type | |
data exp : type → Set where | |
nat : ℕ → exp tNat |
module SingleCaseInduction where | |
-- Usual definition of ℕ | |
data N : Set where | |
z : N | |
s : N → N | |
-- Single case definition of ℕ | |
data _+_ (A : Set) (B : Set) : Set where |
-- This was an exercise: to encode _×_≡_ using _+_≡_ | |
module Multiplication where | |
open import Data.Nat using (ℕ; suc; zero) | |
-- Addition encoded as a type | |
data _+_≡_ : ℕ → ℕ → ℕ → Set where | |
zp : ∀ {n} → zero + n ≡ n | |
sp : ∀ {m n k} → m + n ≡ k → suc m + n ≡ suc k |
(define (person person-name person-age) | |
(define (name) | |
person-name) | |
(define (age) | |
person-age) | |
(lambda (selector) | |
(cond ((equal? selector 'name) (name)) | |
((equal? selector 'age) (age)) | |
(#t '(I cant do that Dave!))))) |
;; All the OO stuff | |
(define (object selector-names . all-selectors) | |
(define (apply-it selector selector-names selectors parameters) | |
(cond ((null? selectors) '(I cant do that Dave!)) | |
((equal? selector (car selector-names)) (apply (car selectors) parameters)) | |
(#t (apply-it selector (cdr selector-names) (cdr selectors) parameters)))) | |
(lambda (selector . parameters) | |
(apply-it selector selector-names all-selectors parameters))) | |
;; Defining a new object type |