Inheritance, down to 99 chars! @Ngnghm
(define (make p b) (letrec ((f (λ (x) ((p f b) x)))) f))
(define ((inherit p q) f s) (p f (q f s)))
Inheritance redux! (define (instance p b) (letrec ((f (λ (x) (p f (b f) x)))) f)) (define ((inherit p q) f s x) (p f (λ (x) (q f s x)) x))
-
-
-
Better put the λ inside the p: (define (make p b) (letrec ((f (p (λ a (apply f a)) b))) f)) or use a lazy language and not need it!
@Ngnghm
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!