hjcapple / reading-sicp Goto Github PK
View Code? Open in Web Editor NEW《计算机程序的构造和解释》(SICP) 解题集
License: MIT License
《计算机程序的构造和解释》(SICP) 解题集
License: MIT License
https://github.com/hjcapple/reading-sicp/blob/master/chapter_3/exercise_3_47.scm
这个里面的22的(lock 'release)是不是应该去掉,也就是n=0的时候,为什么要先释放锁,然后再重试呢,不是应该直接重试吗?
计算的应该是两个较大的数的平方和。
博主是否有检验过答案,有运行成功吗?
我怀疑这题做的不对,理由是 notrival?过程的实参不应为base,而应该为上一次fast-prime?迭代产生的结果。
即使手动单独调用test中的过程也还是不行,请问test模块要怎么运行
Welcome to DrRacket, version 8.6 [cs].
Language: racket, with debugging; memory limit: 128 MB.
(for-loop 0 10 check)
. . for-loop: undefined;
cannot reference an identifier before its definition
第45行后的
((eq? m 'release)
(if (test-and-set! cell)
(the-semaphore 'release))
(set! n (+ n 1))
(clear! cell))
应该改为
((eq? m 'release)
(if (test-and-set! cell)
(the-semaphore 'release)
(begin
(set! n (+ n 1))
(clear! cell))))
否则当锁住时调用release会不断累积 (set! n (+ n 1))
和 (clear! cell)
的调用,在解锁后导致n不正确
chapter_5/exercise_5_20.md
底下的 (const x '())
应为 (cons x '())
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.