We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c02ba00 commit 46c2a2fCopy full SHA for 46c2a2f
test/code/ch3/ex3.38/ex3.38-cbf.sicp
@@ -0,0 +1,17 @@
1
+(%ex "3.38")
2
+
3
+; exercise 3.38, page 303
4
5
+(define (loop)
6
+ (define balance 100)
7
+ (parallel-eval
8
+ (set! balance (+ balance 10))
9
+ (set! balance (- balance 20))
10
+ (set! balance (- balance (/ balance 2))))
11
+ (display "bal: ")
12
+ (display balance)
13
+ (newline)
14
+ ; (loop)
15
+ )
16
17
+(loop)
test/code/ch3/ex3.39/ex3.39-cbf.sicp
@@ -0,0 +1,19 @@
+(%ex "3.39")
+; exercise 3.39, page 306
+(define s (make-serializer))
+; (define s (lambda (x) x))
+ (define x 10)
+ (parallel-execute (lambda () (set! x ((s (lambda () (* x x))))))
+ (s (lambda () (set! x (+ x 1)))))
+ (display "x: ")
+ (display x)
18
19
0 commit comments