Your SlideShare is downloading. ×
0
2010   7   16
2010   7   16
(acknowledgment)




2010   7   16
(who m)


                   http://atnd.org/events/99                           http://qwik.jp/asakusarb/
            htt...
2010   7   16
(about today-tolk)



                 Clojure




2010   7   16
(agenda today)


                • Clojure
                • Clojure

2010   7   16
(feature Clojure)



2010   7   16
(about Clojure)




2010   7   16
Clojure is Lisp
                 Reloaded!!

2010   7   16
(topic clojure)


                •(deffrence Lisp)
                • (use doc)
                • (use lambda :with macro)...
(difference lisp)
                • Clojure             cons



                 • car, cdr
                 • cons       ...
(difference lisp)
                • ()   nil

                •t     true

                • do
                 •

2010  ...
(convenience REPL)
                REPL   (doc func-name)




2010   7   16
(way lambda :with macro)
                            lambda




2010   7   16
(way lambda)
                      lambda




2010   7   16
(way lambda)
                      lambda




2010   7   16
(way lambda)
                      lambda




2010   7   16
(concurrency clojure)



2010   7   16
(why concurrency)

                            CPU




2010   7   16
(why function-programing)




2010   7   16
(case Scala )
                Scala
                                Actor
                                        Java
   ...
(case clojure)
                       Clojure


                (java.util.concurrency   )




2010   7   16
(what concurrency-data-model)


                     •STM
                     •Atom
                     •Agent
2010   7 ...
(what concurrency-data-model)


                     •STM
                     •Atom
                     •Agent
2010   7 ...
(what STM)
                STM




2010   7   16
(difficulty concurency)
                            $x = []
                            $lock = Lock.new
                  ...
(difficulty conccurency)
                             $x = []
                             $lock = Lock.new
               ...
STM



2010   7   16
(why STM)
                        STM




2010   7   16
(about STM)
                       $x = STM.new []
                STM
                       def push_pop(val)
          ...
(about STM)
                Thread A                   Thread B

                   $x.transaction do |v|      $x.transact...
(about STM)
                Thread A                   Thread B

                   $x.transaction do |v|      $x.transact...
(about STM)
                Thread A                   Thread B

                   $x.transaction do |v|      $x.transact...
(about STM)
                Thread A                   Thread B

                   $x.transaction do |v|      $x.transact...
(about STM)
                Thread A                   Thread B

                   $x.transaction do |v|      $x.transact...
(about STM)
                Thread A                   Thread B

                   $x.transaction do |v|      $x.transact...
(defects STM)




2010   7   16
(case Clojure :STM)

                ref :

                deref :

                ref-set :

                dosync :

...
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(case Clojure :STM)




2010   7   16
(more Clojure :STM)


                deref       ref-set   ?




2010   7   16
alter



2010   7   16
(about alter)




2010   7   16
(how alter)




2010   7   16
?



2010   7   16
(more alter)
            alter   ref




2010   7   16
(otherwise alter)
                alter     ref
                commute         commute alter




2010   7   16
(how commute)




2010   7   16
(distinction :alter :commute)




2010   7   16
(distinction :alter :commute)

                          alter     commute
                                  commute




2...
(ref :vaidate)




2010   7   16
(how ref :validate)




2010   7   16
(how ref :validate)




2010   7   16
(how ref :validate)




2010   7   16
(how ref :validate)




2010   7   16
(how ref :validate)




2010   7   16
(how ref :validate)




2010   7   16
(caution transaction)




2010   7   16
(use :macro io! )



                io!



2010   7   16
Haskell
                I/O


2010   7   16
(care *side-effect*)




2010   7   16
(care *side-effect*)




2010   7   16
(last today-story)

                     Scala
                 S             Java
                     Clojure




2010  ...
2010   7   16
2010   7   16
Upcoming SlideShare
Loading in...5
×

不自然なcar/ナチュラルにconsして

3,554

Published on

オブジェクト倶楽部2010夏ピチピチトラック
http://www.objectclub.jp/event/2010summer/session.html#session_pichipichi

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,554
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "不自然なcar/ナチュラルにconsして"

  1. 1. 2010 7 16
  2. 2. 2010 7 16
  3. 3. (acknowledgment) 2010 7 16
  4. 4. (who m) http://atnd.org/events/99 http://qwik.jp/asakusarb/ http://www.slideshare.net/kakutani/kekkon-lt-by-kakutani http://sites.google.com/site/kamenriderbenkyoukai/ http://taiyaki.ru/ 2010 7 16
  5. 5. 2010 7 16
  6. 6. (about today-tolk) Clojure 2010 7 16
  7. 7. (agenda today) • Clojure • Clojure 2010 7 16
  8. 8. (feature Clojure) 2010 7 16
  9. 9. (about Clojure) 2010 7 16
  10. 10. Clojure is Lisp Reloaded!! 2010 7 16
  11. 11. (topic clojure) •(deffrence Lisp) • (use doc) • (use lambda :with macro) 2010 7 16
  12. 12. (difference lisp) • Clojure cons • car, cdr • cons cons 2010 7 16
  13. 13. (difference lisp) • () nil •t true • do • 2010 7 16
  14. 14. (convenience REPL) REPL (doc func-name) 2010 7 16
  15. 15. (way lambda :with macro) lambda 2010 7 16
  16. 16. (way lambda) lambda 2010 7 16
  17. 17. (way lambda) lambda 2010 7 16
  18. 18. (way lambda) lambda 2010 7 16
  19. 19. (concurrency clojure) 2010 7 16
  20. 20. (why concurrency) CPU 2010 7 16
  21. 21. (why function-programing) 2010 7 16
  22. 22. (case Scala ) Scala Actor Java Scala 2010 7 16
  23. 23. (case clojure) Clojure (java.util.concurrency ) 2010 7 16
  24. 24. (what concurrency-data-model) •STM •Atom •Agent 2010 7 16
  25. 25. (what concurrency-data-model) •STM •Atom •Agent 2010 7 16
  26. 26. (what STM) STM 2010 7 16
  27. 27. (difficulty concurency) $x = [] $lock = Lock.new def push_pop(val) $lock.lock $x << val retval = $x.pop $lock.unlock retval end 2010 7 16
  28. 28. (difficulty conccurency) $x = [] $lock = Lock.new def push_pop(val) $lock.lock $x << val retval = $x.pop $lock.unlock retval end 2010 7 16
  29. 29. STM 2010 7 16
  30. 30. (why STM) STM 2010 7 16
  31. 31. (about STM) $x = STM.new [] STM def push_pop(val) retval = nil $x.transaction do |v| v << val retval = v.pop end retval end 2010 7 16
  32. 32. (about STM) Thread A Thread B $x.transaction do |v| $x.transaction do |v| v << val v << val retval = v.pop retval = v.pop end end 2010 7 16
  33. 33. (about STM) Thread A Thread B $x.transaction do |v| $x.transaction do |v| v << val v << val retval = v.pop retval = v.pop end end 2010 7 16
  34. 34. (about STM) Thread A Thread B $x.transaction do |v| $x.transaction do |v| v << val v << val retval = v.pop retval = v.pop end end 2010 7 16
  35. 35. (about STM) Thread A Thread B $x.transaction do |v| $x.transaction do |v| v << val v << val retval = v.pop retval = v.pop end end 2010 7 16
  36. 36. (about STM) Thread A Thread B $x.transaction do |v| $x.transaction do |v| v << val v << val retval = v.pop retval = v.pop end end Thread A $x 2010 7 16
  37. 37. (about STM) Thread A Thread B $x.transaction do |v| $x.transaction do |v| v << val v << val retval = v.pop retval = v.pop end end Thread B 2010 7 16
  38. 38. (defects STM) 2010 7 16
  39. 39. (case Clojure :STM) ref : deref : ref-set : dosync : 2010 7 16
  40. 40. (case Clojure :STM) 2010 7 16
  41. 41. (case Clojure :STM) 2010 7 16
  42. 42. (case Clojure :STM) 2010 7 16
  43. 43. (case Clojure :STM) 2010 7 16
  44. 44. (case Clojure :STM) 2010 7 16
  45. 45. (case Clojure :STM) 2010 7 16
  46. 46. (case Clojure :STM) 2010 7 16
  47. 47. (case Clojure :STM) 2010 7 16
  48. 48. (case Clojure :STM) 2010 7 16
  49. 49. (more Clojure :STM) deref ref-set ? 2010 7 16
  50. 50. alter 2010 7 16
  51. 51. (about alter) 2010 7 16
  52. 52. (how alter) 2010 7 16
  53. 53. ? 2010 7 16
  54. 54. (more alter) alter ref 2010 7 16
  55. 55. (otherwise alter) alter ref commute commute alter 2010 7 16
  56. 56. (how commute) 2010 7 16
  57. 57. (distinction :alter :commute) 2010 7 16
  58. 58. (distinction :alter :commute) alter commute commute 2010 7 16
  59. 59. (ref :vaidate) 2010 7 16
  60. 60. (how ref :validate) 2010 7 16
  61. 61. (how ref :validate) 2010 7 16
  62. 62. (how ref :validate) 2010 7 16
  63. 63. (how ref :validate) 2010 7 16
  64. 64. (how ref :validate) 2010 7 16
  65. 65. (how ref :validate) 2010 7 16
  66. 66. (caution transaction) 2010 7 16
  67. 67. (use :macro io! ) io! 2010 7 16
  68. 68. Haskell I/O 2010 7 16
  69. 69. (care *side-effect*) 2010 7 16
  70. 70. (care *side-effect*) 2010 7 16
  71. 71. (last today-story) Scala S Java Clojure 2010 7 16
  72. 72. 2010 7 16
  73. 73. 2010 7 16
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×