Advertisement
Guest User

Untitled

a guest
Dec 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.36 KB | None | 0 0
  1. ; 8/9th function
  2. (define (my-delay thunk)
  3.  (mcons 0 (mcons thunk thunk)))
  4.  
  5. (define (my-force prom)
  6.   (if (= (modulo (mcar prom) 5) 0)
  7.       (begin (set-mcar! prom (+ (mcar prom) 1))
  8.              (set-mcar! (mcdr prom) ((mcdr (mcdr prom))))
  9.              (mcar (mcdr prom)))
  10.       (begin (set-mcar! prom (+ (mcar prom) 1))
  11.              (mcar (mcdr prom)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement