拉一段程序,仍然是“复数”的例子:
(define (make-complex real image)
(define (dispatch command)
(cond ((eq? command 'get-real) real)
((eq? command 'get-image) image)
(else "DONNOT SUPPORT THIS OPERATION -- COMPLEX")))
dispatch)
(define (get-real complex)
(complex 'get-real))
(define (get-image complex)
(complex 'get-image))
(define complex1 (make-complex 2 3))
(get-real complex1)
(get-image complex1)
-------
2
3
- 作者: 透明 2005年07月15日, 星期五 14:19
你可以使用这个链接引用该篇日志 http://publishblog.blogdriver.com/blog/tb.b?diaryID=816992
。。。。。。。。。。。
http://nulia.3322.org
http://nuli2.8800.org
http://nulic.6600.org
http://nulid.2288.org
http://nulie.3322.org