Upcoming SlideShare
×

Learning Lisp

954 views
897 views

Published on

Video of presentation available on youtube:

Published in: Technology, Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
954
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
4
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 &amp;#xE5; manipulere kode, p&amp;#xE5; samme m&amp;#xE5;te som data\n\n\n\n
• Compile time metaprogrammering - ingen performance overhead\nMan bruker vanlige funksjoner til &amp;#xE5; manipulere kode, p&amp;#xE5; samme m&amp;#xE5;te som data\n\n\n\n
• Compile time metaprogrammering - ingen performance overhead\nMan bruker vanlige funksjoner til &amp;#xE5; manipulere kode, p&amp;#xE5; samme m&amp;#xE5;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. Preﬁx 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