Updated: 9/1/2002; 9:32:09 PM
Anthony Lorelli
    "Why can't a dog simulate pain? Is he too honest?" -Wittgenstein

daily link  Sunday, August 18, 2002

Was at the bookstore the other night and saw that the Chronicles of Narnia have been renumbered - ?!?! Asked David Greenfield about it and he replied that it had been done some time ago. The (relatively) new numbering puts the volumes in chronological order, which means The Magician's Nephew comes first - truly unfortunate, because The Lion, the Witch, and the Wardrobe, which now comes second, is a better introduction to the realm.

When I read the stories in the fourth and fifth grade, I had no trouble understanding that the volumes described events that weren't in proper chronological order. Why make that change? 
11:49:04 PM  permalink 

A solution for EoPL exercise 2.5:
(define-datatype bintree bintree?
  (leaf-node
    (datum number?))
  (interior-node
    (key symbol?)
    (left bintree?)
    (right bintree?)))

(define interior-node? (lambda (node) (cases bintree node (leaf-node (datum) #f) (interior-node (key left right) #t))))

(define leaf-sum (lambda (tree) (cases bintree tree (leaf-node (datum) datum) (interior-node (key left right) (+ (leaf-sum left) (leaf-sum right))))))

(define greater-node (lambda (nodea nodeb) (if (null? nodea) (if (null? nodeb) '() nodeb) (if (null? nodeb) nodea (if (> (cadr nodea) (cadr nodeb)) nodea nodeb)))))

(define max-interior (lambda (tree) (letrec ((max-int-rec (lambda (tree) (cases bintree tree (leaf-node (datum) datum) (interior-node (key left right) (let ((left-sum (if (interior-node? left) (max-int-rec left) '())) (right-sum (if (interior-node? right) (max-int-rec right) '())) (current-sum (list key (+ (leaf-sum left) (leaf-sum right))))) (greater-node current-sum (greater-node left-sum right-sum)))))))) (car (max-int-rec tree)))))

 
11:17:53 PM  permalink 

Copyright 2002 © Anthony Lorelli

jenett.radio.simplicity.v2.1
theme designed by
jenett.radio