daily pastebin goal
38%
SHARE
TWEET

Example1

a guest Feb 8th, 2013 28 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; ------------------------------------------------------------------------------------------
  2. ;; 1
  3. #lang racket/base
  4. (define z
  5.   (let ([x 10]
  6.         [y 10])
  7.     (+ x y)))
  8. ; ==>
  9. (module example11 racket/base
  10.   (#%module-begin
  11.    (define-values (z)
  12.      (let-values (((x) (quote 10)) ((y) (quote 10))) (#%app + x y)))))
  13.  
  14. ;; ------------------------------------------------------------------------------------------
  15. ;; 2
  16. #lang racket/base
  17. (define z
  18.   (let ()
  19.     (define x 10)
  20.     (define y 10)
  21.     (+ x y)))
  22. ; ==>
  23. (module example12 racket/base
  24.   (#%module-begin
  25.    (define-values (z)
  26.      (let-values ()
  27.        (let-values (((x) (quote 10))) (let-values (((y) (quote 10))) (#%app + x y)))))))
  28.  
  29. ;; ------------------------------------------------------------------------------------------
  30. ;; 3
  31. #lang racket/base
  32. (require racket/block)
  33. (define z
  34.   (block
  35.    (define x 10)
  36.    (define y 10)
  37.    (+ x y)))
  38. ;==>
  39. (module example13 racket/base
  40.   (#%module-begin
  41.    (#%require racket/block)
  42.    (define-values (z)
  43.      (let-values (((x) (quote 10))) (let-values (((y) (quote 10))) (#%app + x y))))))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top