一个不错的scheme入门PPT
摘要:来自于:Greg J.BadrosUniversity of WashingtonCSE-341文件在这里
阅读全文
《4个程序员的一天》(续) 由idior的问题想到的
摘要:在《4个程序员的一天》一文中,idior问道: 不知道类似foo(+,-,+,*,/, a) //a is a array实现a[0]+a[1]+a[2]*a[3]/a[4]这种功能能实现吗?(用FP) 昨晚去看了看scheme的数据结构操作,得出以下解法:(;号后面是注释)(define (inner-runner 1st-number operators numbers) (if ...
阅读全文
回FantasySoft
摘要:FantasySoft兄的贴在这里hehe,其实我是偷懒没用那些复杂的函数来当op,直接把+传进去吧了。Scheme里面,数据和函数都是一回事,没有区别的。如果op是个复杂的函数,还是需要先吧这个函数定义出来,再传进去。比如现在我们op操作符不再是加法这么简单,而是要算x和y的平方和是多少,即:x^2 + y^2 = ?如何用scheme来做呢?首先我们的Foo的定义不用变,还是(define (...
阅读全文
4个程序员的一天
摘要:【声明:本文没有贬低某个编程语言的意思】Please Note: 2005/10/14I found some friends republished this post and forget keep the original information, so please:1. Please don't forget keep the original address in your post....
阅读全文
Solution for SICP
摘要:因为找不到SICP的辅导书, 有些要求explain的solution就不知道答案了, sigh...不知道直接去找MIT的教授要, 他们会不会给...1.1.7 Square Roots by Newton's Method(define (avg x y) (/ (+ x y) 2))(define (abs x) (if (< x 0) (- x) x))(defin...
阅读全文