Guest User

Untitled

a guest
Feb 25th, 2016
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Here's why OCaml falls in the category “values are immutable”:
  2.  
  3. lolcathost% ocaml
  4. OCaml version 4.02.3
  5.  
  6. # let x = 5;;
  7. val x : int = 5
  8. # let f y = x + y;;
  9. val f : int -> int = <fun>
  10. # let x = 0;;
  11. val x : int = 0
  12. # f 10;;
  13. - : int = 15
  14.  
  15. Here's why Clojure falls in the category “anything goes”:
  16.  
  17. lolcathost% clojure
  18. Clojure 1.8.0
  19. user=> (def x 5)
  20. #'user/x
  21. user=> (defn f [y] (+ x y))
  22. #'user/f
  23. user=> (def x 0)
  24. #'user/x
  25. user=> (f 10)
  26. 10
  27. user=>
  28.  
  29. Here's why Racket in the REPL also falls in the category “anything goes”:
  30.  
  31. lolcathost% racket
  32. Welcome to Racket v6.4.
  33. > (define x 5)
  34. > (define (f y) (+ x y))
  35. > (define x 0)
  36. > (f 10)
  37. 10
  38. >
Advertisement
Add Comment
Please, Sign In to add comment