Learning Lisp
Upcoming SlideShare
Loading in...5
×
 

Learning Lisp

on

  • 911 views

Video of presentation available on youtube:

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

Statistics

Views

Total Views
911
Views on SlideShare
909
Embed Views
2

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 2

https://lti-examples.heroku.com 2

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \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 Learning Lisp Presentation Transcript

  • Learning Lisp Alf Kristian Støyle
  • sum(1, 2);
  • sum(1, 2)
  • (sum 1, 2)
  • (sum 1 2)
  • (sum 1 2)
  • (sum 1 2)
  • Prefix notationFunction name Parameters (sum 1 2)
  • (sum 1 2)
  • (sum)(sum 1 2)(sum 1 2 3)
  • (sum);=> 0(sum 1 2);=> 3(sum 1 2 3);=> 6
  • (+);=> 0(+ 1 2);=> 3(+ 1 2 3);=> 6
  • (+);=> 0(+ 1 2) 1 + 2;=> 3(+ 1 2 3) 1 + 2 + 3;=> 6
  • Lists(3 2 1);=> (3 2 1)(+ 3 2 1);=> 6
  • Lists(3 2 1);=> (3 2 1)(+ 3 2 1);=> 6(defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
  • Lists(3 2 1);=> (3 2 1)(+ 3 2 1);=> 6(defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
  • Macros(1 + 2)
  • Macros(infix (1 + 2));=> 3
  • Macros(infix (1 + 2));=> 3(defmacro infix [form] `(~(second form) ~(first form) ~@(nnext form)))
  • Macros(infix (1 + 2));=> 3(defmacro infix [form] `(~(second form) ~(first form) ~@(nnext form)))(macroexpand (infix (1 + 2)));=> (+ 1 2)
  • (defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
  • Abstract syntax tree(defn iterate [f x] (cons x (lazy-seq (iterate f (f x)))))
  • Clojure