Learning Lisp

954 views
897 views

Published on

Video of presentation available on youtube:
http://www.youtube.com/watch?v=y9RekASi2MI

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

  • Be the first to like this

No Downloads
Views
Total views
954
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • Cambridge polish notation\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Parens are actually literals for lists.\nData and code has the same representation.\n
  • Parens are actually literals for lists.\nData and code has the same representation.\n
  • Compile time metaprogrammering - ingen performance overhead\nMan bruker vanlige funksjoner til å manipulere kode, på samme måte som data\n\n\n\n
  • Compile time metaprogrammering - ingen performance overhead\nMan bruker vanlige funksjoner til å manipulere kode, på samme måte som data\n\n\n\n
  • Compile time metaprogrammering - ingen performance overhead\nMan bruker vanlige funksjoner til å manipulere kode, på samme måte som data\n\n\n\n
  • \n
  • \n
  • \n
  • Learning Lisp

    1. 1. Learning Lisp Alf Kristian Støyle
    2. 2. sum(1, 2);
    3. 3. sum(1, 2)
    4. 4. (sum 1, 2)
    5. 5. (sum 1 2)
    6. 6. (sum 1 2)
    7. 7. (sum 1 2)
    8. 8. Prefix notationFunction name Parameters (sum 1 2)
    9. 9. (sum 1 2)
    10. 10. (sum)(sum 1 2)(sum 1 2 3)
    11. 11. (sum);=> 0(sum 1 2);=> 3(sum 1 2 3);=> 6
    12. 12. (+);=> 0(+ 1 2);=> 3(+ 1 2 3);=> 6
    13. 13. (+);=> 0(+ 1 2) 1 + 2;=> 3(+ 1 2 3) 1 + 2 + 3;=> 6
    14. 14. Lists(3 2 1);=> (3 2 1)(+ 3 2 1);=> 6
    15. 15. Lists(3 2 1);=> (3 2 1)(+ 3 2 1);=> 6(defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
    16. 16. Lists(3 2 1);=> (3 2 1)(+ 3 2 1);=> 6(defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
    17. 17. Macros(1 + 2)
    18. 18. Macros(infix (1 + 2));=> 3
    19. 19. Macros(infix (1 + 2));=> 3(defmacro infix [form] `(~(second form) ~(first form) ~@(nnext form)))
    20. 20. Macros(infix (1 + 2));=> 3(defmacro infix [form] `(~(second form) ~(first form) ~@(nnext form)))(macroexpand (infix (1 + 2)));=> (+ 1 2)
    21. 21. (defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
    22. 22. Abstract syntax tree(defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
    23. 23. Clojure

    ×