l***@gmail.com
2018-01-18 08:13:49 UTC
çŒçšæ°æåšç The Little Schemer <https://book.douban.com/subject/1632977/>
TLS ch4 p78
Can we assume that all functions written using eq ? can be generalized by
replacing eq ? by eqan ?
answer:
Yes, except , of course, for eqan? itself.
In TLS, eq? takes two arguments. Each must be a nonnumeric atom.
(define eqan?
(lambda (a1 a2)
(cond
((and (number? a1) (number? a2))
(= a1 a2))
((or (number? a1) (number? a2)) #f)
(else (eq? a1 a2)))))
é®é¢
Yes, except , of course, for eqan? itself.
è¿å¥è¯æ¯ä»ä¹ææïŒ
æçç解æ¯æ eqan? åœäœå®èªå·±çåæ°è¿è¡æ¯èŸïŒç±»äŒŒ
(eqan? eqan? eqan?)
åš jupyter calysto scheme éæµè¯çç»æéœæ¯ trueãæç §ä¹Šäžçæææ¯æ æ³æ¯èŸåïŒåºè¯¥æä¹ç解ïŒ
[image: eqan]
â
TLS ch4 p78
Can we assume that all functions written using eq ? can be generalized by
replacing eq ? by eqan ?
answer:
Yes, except , of course, for eqan? itself.
In TLS, eq? takes two arguments. Each must be a nonnumeric atom.
(define eqan?
(lambda (a1 a2)
(cond
((and (number? a1) (number? a2))
(= a1 a2))
((or (number? a1) (number? a2)) #f)
(else (eq? a1 a2)))))
é®é¢
Yes, except , of course, for eqan? itself.
è¿å¥è¯æ¯ä»ä¹ææïŒ
æçç解æ¯æ eqan? åœäœå®èªå·±çåæ°è¿è¡æ¯èŸïŒç±»äŒŒ
(eqan? eqan? eqan?)
åš jupyter calysto scheme éæµè¯çç»æéœæ¯ trueãæç §ä¹Šäžçæææ¯æ æ³æ¯èŸåïŒåºè¯¥æä¹ç解ïŒ
[image: eqan]
â
--
--
Lisp-cn(Lispäžæçšæ·ç»)
CLUG http://lisp.org.cn
---
æšæ¶å°æ€é®ä»¶æ¯å 䞺æšè®¢é äº Google çœäžè®ºåçâLisp-cn(Lispäžæçšæ·ç»)â矀ç»ã
èŠé订æ€çŸ€ç»å¹¶åæ¢æ¥æ¶æ€çŸ€ç»ççµåé®ä»¶ïŒè¯·åéçµåé®ä»¶å°lisp-cn+***@googlegroups.comã
èŠæ¥çæŽå€é项ïŒè¯·è®¿é® https://groups.google.com/d/optoutã
--
Lisp-cn(Lispäžæçšæ·ç»)
CLUG http://lisp.org.cn
---
æšæ¶å°æ€é®ä»¶æ¯å 䞺æšè®¢é äº Google çœäžè®ºåçâLisp-cn(Lispäžæçšæ·ç»)â矀ç»ã
èŠé订æ€çŸ€ç»å¹¶åæ¢æ¥æ¶æ€çŸ€ç»ççµåé®ä»¶ïŒè¯·åéçµåé®ä»¶å°lisp-cn+***@googlegroups.comã
èŠæ¥çæŽå€é项ïŒè¯·è®¿é® https://groups.google.com/d/optoutã