あなたがSchemeを使うべき10の理由

2,091 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,091
On SlideShare
0
From Embeds
0
Number of Embeds
231
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

あなたがSchemeを使うべき10の理由

  1. 1. Scheme 10 yadokarielectric aka y14c | yad-EL
  2. 2. 100
  3. 3. Scheme
  4. 4. Hello World
  5. 5. C
  6. 6. int main() { printf(“Hello World!”); return 0; }
  7. 7. •() • {}
  8. 8. Java
  9. 9. public class HelloWorld { public static void main (String [] args) { System.out.println(“Hello World!”); } }
  10. 10. •() • {} • []
  11. 11. Scheme
  12. 12. (display “Hello World!”)
  13. 13. •C • Java
  14. 14. Scheme
  15. 15. Scheme
  16. 16. lambda
  17. 17. (lambda ( )( ))
  18. 18. .
  19. 19. • if (lambda (p x y) (p x y)) • true (lambda (x y) x) • false (lambda (x y) y)
  20. 20. .
  21. 21. Scheme
  22. 22. ((lambda (f) ((lambda (p) (f (lambda (x) ((p p) x)))) (lambda (p) (f (lambda (x) ((p p) x)))))) (lambda (f) (f )))
  23. 23. Scheme
  24. 24. ((lambda (f) ((lambda (p) (f (lambda (x) ((p p) x)))) (lambda (p) (f (lambda (x) ((p p) x)))))) (lambda (f) (lambda (n) (((lambda (n) ((n (lambda (x) (lambda (x y) y))) (lambda (x y) x))) n) (lambda (c) (lambda (x) (c x))) (lambda (c) (lambda (x) (((f (lambda (c) (lambda (x) (((n (lambda (g) (lambda (h) (h (g c))))) (lambda (u) x)) (lambda (u) u))))) (n c)) x)))))))
  25. 25. lambda
  26. 26. Scheme • •
  27. 27. Scheme 10
  28. 28. (= #b10 2)
  29. 29. (= #b10 2) #t
  30. 30. ↓ (= #b10 2) #t

×