SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Downloaden Sie, um offline zu lesen
Text
The Root of Lisp
Paul Graham
Presenter: Ofa
Date: 2015.3.12
Agenda
John McCarthy
Operators
Function
Surprise
John McCarthy
Operators + notation for
functions = whole
programming language
C model vs Lisp model
The Euclid for
programming!!!
Operators
Expression = an atom or a list of
zero or more expressions
Atom: foo
List: (), ,(foo bar), (a b (c) d)
Value:
ex. 1+1=2; 1+1=>e, 2=>v, said
e returns v
If an e is a list, it can be the form:
(operator arguments*)
( ( 1 + 2 ) * 3)
( * ( + 1 2 ) 3 )
Symbolic
expression
List Atom
Number Symbol
Operators
(quote x) returns x
> ‘x
x
(atom x) returns the atom t if the
value of x is an atom or the empty
list, otherwise it returns () (falsity)
> (atom ‘a)
t
> (atom ‘(a b c))
()
Most distinctive feature of Lisp:
Code and data are made out of the same
data structures︎ and the quote operator is
the way we distinguish between them︎
Operators
(eq x y) returns t if x and y are the
same atom or both the empty list,
() otherwise
> (eq ‘x ‘x)
t
(car x) expects the value of x to
be a list, and returns the first
element of x
> (car ‘(a b c) )
a
(cdr x) expects the value of x be
a list, and returns everything after
the first element
> (cdr ‘(a b c) )
(b c)
(cons x y) expects the value of y
to be a list, and returns a list
containing the value of x followed
by the elements of the value of y
> (cons ‘a ‘(b c))
(a b c)
> (cdr (cons ‘a ‘(b c))
(b c)
Operators
(cond (p1 e1)…(pn en) ) the p
expressions are evaluated in order
until one returns t; when one is
found, the value of the
corresponding e expression is
returned
> (cond ( ( eq ‘a ‘b) ‘first) ( (
atom ‘a) ‘second) )
second
the same as {key, value} in C styled
Function
Function call
( ( lambda (p1…pn) e) a1…an)
p1 <- e(a1), a1 is evaluated and then e, p1
becomes the corresponding value of a1
> ( ( lambda (x y) (cons( x (cdr y) ) ) ‘z ‘(a b c) )
(z b c)
Surprise
A function that turns out to be an interpreter of a
language?!
-> We can define a function that takes as an
argument any Lisp expression, and returns its value
ref page 8 to see the details
Summary
Recursion
A new concept of variables
Garbage-collection
Programs composed of
expressions
The whole language always
available
Python!!!

Weitere ähnliche Inhalte

Was ist angesagt?

Functional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative ProgrammersFunctional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative ProgrammersChris
 
Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...
Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...
Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...hwbloom38
 
TI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class FunctionsTI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class FunctionsEelco Visser
 
The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88Mahmoud Samir Fayed
 
Application of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaApplication of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaDipayan Sarkar
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35ecomputernotes
 
Lecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureLecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureNurjahan Nipa
 
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogrammingdudarev
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)Sylvain Hallé
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)Sylvain Hallé
 
Functional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for MaintainabilityFunctional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for MaintainabilityMarcin Stepien
 
Stack application
Stack applicationStack application
Stack applicationStudent
 
Revisiting Combinators
Revisiting CombinatorsRevisiting Combinators
Revisiting CombinatorsEdward Kmett
 
computer notes - Data Structures - 8
computer notes - Data Structures - 8computer notes - Data Structures - 8
computer notes - Data Structures - 8ecomputernotes
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sortingKaushal Shah
 
A formalization of complex event stream processing
A formalization of complex event stream processingA formalization of complex event stream processing
A formalization of complex event stream processingSylvain Hallé
 

Was ist angesagt? (20)

Functional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative ProgrammersFunctional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative Programmers
 
Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...
Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...
Part II: 2-Dimensional Array file name: lab1part2.cpp (10 points) Write a C++...
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
TI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class FunctionsTI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class Functions
 
The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88
 
Application of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaApplication of Stack - Yadraj Meena
Application of Stack - Yadraj Meena
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
Lecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureLecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structure
 
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
 
Functional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for MaintainabilityFunctional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for Maintainability
 
Daa chapter5
Daa chapter5Daa chapter5
Daa chapter5
 
Stack application
Stack applicationStack application
Stack application
 
Revisiting Combinators
Revisiting CombinatorsRevisiting Combinators
Revisiting Combinators
 
Queues in C++
Queues in C++Queues in C++
Queues in C++
 
computer notes - Data Structures - 8
computer notes - Data Structures - 8computer notes - Data Structures - 8
computer notes - Data Structures - 8
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sorting
 
A formalization of complex event stream processing
A formalization of complex event stream processingA formalization of complex event stream processing
A formalization of complex event stream processing
 
Stack
StackStack
Stack
 

Ähnlich wie 2015.3.12 the root of lisp

Advance LISP (Artificial Intelligence)
Advance LISP (Artificial Intelligence) Advance LISP (Artificial Intelligence)
Advance LISP (Artificial Intelligence) wahab khan
 
Futzing with actors (etc.)
Futzing with actors (etc.)Futzing with actors (etc.)
Futzing with actors (etc.)league
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARDTia Ricci
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsKirill Kozlov
 
Programming in lua STRING AND ARRAY
Programming in lua STRING AND ARRAYProgramming in lua STRING AND ARRAY
Programming in lua STRING AND ARRAYvikram mahendra
 
Python High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.pptPython High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.pptAnishaJ7
 
Functional Programming by Examples using Haskell
Functional Programming by Examples using HaskellFunctional Programming by Examples using Haskell
Functional Programming by Examples using Haskellgoncharenko
 
system software
system software system software
system software randhirlpu
 
mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learnpavan373
 
Python programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsPython programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsMegha V
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfTimothy McBush Hiele
 
Free Monads Getting Started
Free Monads Getting StartedFree Monads Getting Started
Free Monads Getting StartedKent Ohashi
 
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQProvectus
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Sheik Uduman Ali
 

Ähnlich wie 2015.3.12 the root of lisp (20)

(Ai lisp)
(Ai lisp)(Ai lisp)
(Ai lisp)
 
Advance LISP (Artificial Intelligence)
Advance LISP (Artificial Intelligence) Advance LISP (Artificial Intelligence)
Advance LISP (Artificial Intelligence)
 
Futzing with actors (etc.)
Futzing with actors (etc.)Futzing with actors (etc.)
Futzing with actors (etc.)
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. Monads
 
Programming in lua STRING AND ARRAY
Programming in lua STRING AND ARRAYProgramming in lua STRING AND ARRAY
Programming in lua STRING AND ARRAY
 
Frp2016 3
Frp2016 3Frp2016 3
Frp2016 3
 
Python High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.pptPython High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.ppt
 
purrr.pdf
purrr.pdfpurrr.pdf
purrr.pdf
 
Functional Programming by Examples using Haskell
Functional Programming by Examples using HaskellFunctional Programming by Examples using Haskell
Functional Programming by Examples using Haskell
 
Array
ArrayArray
Array
 
system software
system software system software
system software
 
mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learn
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
 
Python programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsPython programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operations
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdf
 
Free Monads Getting Started
Free Monads Getting StartedFree Monads Getting Started
Free Monads Getting Started
 
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0
 

Mehr von Chung-Hsiang Ofa Hsueh

2018.06.03.the hard thing about hard things for hpx-kh
2018.06.03.the hard thing about hard things for hpx-kh2018.06.03.the hard thing about hard things for hpx-kh
2018.06.03.the hard thing about hard things for hpx-khChung-Hsiang Ofa Hsueh
 
YC Startup School 2016 Info sharing@inbetween international
YC Startup School 2016 Info sharing@inbetween internationalYC Startup School 2016 Info sharing@inbetween international
YC Startup School 2016 Info sharing@inbetween internationalChung-Hsiang Ofa Hsueh
 
Introduction of Silicon Valley Innovation Safari
Introduction of Silicon Valley Innovation SafariIntroduction of Silicon Valley Innovation Safari
Introduction of Silicon Valley Innovation SafariChung-Hsiang Ofa Hsueh
 
2016.3.22 從車庫的舊pc到百萬台伺服器
2016.3.22 從車庫的舊pc到百萬台伺服器2016.3.22 從車庫的舊pc到百萬台伺服器
2016.3.22 從車庫的舊pc到百萬台伺服器Chung-Hsiang Ofa Hsueh
 
2015.6.29 以色列新創背包攻略本
2015.6.29 以色列新創背包攻略本2015.6.29 以色列新創背包攻略本
2015.6.29 以色列新創背包攻略本Chung-Hsiang Ofa Hsueh
 
2015.11.21 Scrum:用一半的時間做兩倍的事
2015.11.21 Scrum:用一半的時間做兩倍的事2015.11.21 Scrum:用一半的時間做兩倍的事
2015.11.21 Scrum:用一半的時間做兩倍的事Chung-Hsiang Ofa Hsueh
 
2015.10.31 淺談矽谷的fintech趨勢
2015.10.31 淺談矽谷的fintech趨勢2015.10.31 淺談矽谷的fintech趨勢
2015.10.31 淺談矽谷的fintech趨勢Chung-Hsiang Ofa Hsueh
 
2015.9.2 矽谷與以色列的祕密醬汁
2015.9.2 矽谷與以色列的祕密醬汁2015.9.2 矽谷與以色列的祕密醬汁
2015.9.2 矽谷與以色列的祕密醬汁Chung-Hsiang Ofa Hsueh
 

Mehr von Chung-Hsiang Ofa Hsueh (20)

Secret weapons for startups
Secret weapons for startupsSecret weapons for startups
Secret weapons for startups
 
Head first latex
Head first latexHead first latex
Head first latex
 
Mlcc #4
Mlcc #4Mlcc #4
Mlcc #4
 
MLCC #2
MLCC #2MLCC #2
MLCC #2
 
2018.06.03.the hard thing about hard things for hpx-kh
2018.06.03.the hard thing about hard things for hpx-kh2018.06.03.the hard thing about hard things for hpx-kh
2018.06.03.the hard thing about hard things for hpx-kh
 
YC Startup School 2016 Info sharing@inbetween international
YC Startup School 2016 Info sharing@inbetween internationalYC Startup School 2016 Info sharing@inbetween international
YC Startup School 2016 Info sharing@inbetween international
 
2016.7.19 汽車駭客手冊
2016.7.19 汽車駭客手冊2016.7.19 汽車駭客手冊
2016.7.19 汽車駭客手冊
 
2016.6.17 TEIL group meeting
2016.6.17 TEIL group meeting2016.6.17 TEIL group meeting
2016.6.17 TEIL group meeting
 
Introduction of Silicon Valley Innovation Safari
Introduction of Silicon Valley Innovation SafariIntroduction of Silicon Valley Innovation Safari
Introduction of Silicon Valley Innovation Safari
 
Ec x fintech
Ec x fintechEc x fintech
Ec x fintech
 
2016.3.22 從車庫的舊pc到百萬台伺服器
2016.3.22 從車庫的舊pc到百萬台伺服器2016.3.22 從車庫的舊pc到百萬台伺服器
2016.3.22 從車庫的舊pc到百萬台伺服器
 
2015.6.29 以色列新創背包攻略本
2015.6.29 以色列新創背包攻略本2015.6.29 以色列新創背包攻略本
2015.6.29 以色列新創背包攻略本
 
2015.11.21 Scrum:用一半的時間做兩倍的事
2015.11.21 Scrum:用一半的時間做兩倍的事2015.11.21 Scrum:用一半的時間做兩倍的事
2015.11.21 Scrum:用一半的時間做兩倍的事
 
2015.10.31 淺談矽谷的fintech趨勢
2015.10.31 淺談矽谷的fintech趨勢2015.10.31 淺談矽谷的fintech趨勢
2015.10.31 淺談矽谷的fintech趨勢
 
Pretotype it
Pretotype itPretotype it
Pretotype it
 
2015.9.2 矽谷與以色列的祕密醬汁
2015.9.2 矽谷與以色列的祕密醬汁2015.9.2 矽谷與以色列的祕密醬汁
2015.9.2 矽谷與以色列的祕密醬汁
 
2015.1.5 os.server.keyterms
2015.1.5 os.server.keyterms2015.1.5 os.server.keyterms
2015.1.5 os.server.keyterms
 
2015.06.16 why silicon valley matters
2015.06.16 why silicon valley matters2015.06.16 why silicon valley matters
2015.06.16 why silicon valley matters
 
2015.4.10 守護程序ii 自由之戰
2015.4.10 守護程序ii 自由之戰2015.4.10 守護程序ii 自由之戰
2015.4.10 守護程序ii 自由之戰
 
2015.4.7 startup nation
2015.4.7 startup nation2015.4.7 startup nation
2015.4.7 startup nation
 

Kürzlich hochgeladen

Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243Sérgio Sacani
 
Mitosis...............................pptx
Mitosis...............................pptxMitosis...............................pptx
Mitosis...............................pptxCherry
 
Climate extremes likely to drive land mammal extinction during next supercont...
Climate extremes likely to drive land mammal extinction during next supercont...Climate extremes likely to drive land mammal extinction during next supercont...
Climate extremes likely to drive land mammal extinction during next supercont...Sérgio Sacani
 
Cell Immobilization Methods and Applications.pptx
Cell Immobilization Methods and Applications.pptxCell Immobilization Methods and Applications.pptx
Cell Immobilization Methods and Applications.pptxCherry
 
Hemoglobin metabolism: C Kalyan & E. Muralinath
Hemoglobin metabolism: C Kalyan & E. MuralinathHemoglobin metabolism: C Kalyan & E. Muralinath
Hemoglobin metabolism: C Kalyan & E. Muralinathmuralinath2
 
The solar dynamo begins near the surface
The solar dynamo begins near the surfaceThe solar dynamo begins near the surface
The solar dynamo begins near the surfaceSérgio Sacani
 
Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...
Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...
Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...Sérgio Sacani
 
Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...
Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...
Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...Sahil Suleman
 
The Scientific names of some important families of Industrial plants .pdf
The Scientific names of some important families of Industrial plants .pdfThe Scientific names of some important families of Industrial plants .pdf
The Scientific names of some important families of Industrial plants .pdfMohamed Said
 
Tuberculosis (TB)-Notes.pdf microbiology notes
Tuberculosis (TB)-Notes.pdf microbiology notesTuberculosis (TB)-Notes.pdf microbiology notes
Tuberculosis (TB)-Notes.pdf microbiology notesjyothisaisri
 
Microbial bio Synthesis of nanoparticles.pptx
Microbial bio Synthesis of nanoparticles.pptxMicrobial bio Synthesis of nanoparticles.pptx
Microbial bio Synthesis of nanoparticles.pptxCherry
 
Plasmapheresis - Dr. E. Muralinath - Kalyan . C.pptx
Plasmapheresis - Dr. E. Muralinath - Kalyan . C.pptxPlasmapheresis - Dr. E. Muralinath - Kalyan . C.pptx
Plasmapheresis - Dr. E. Muralinath - Kalyan . C.pptxmuralinath2
 
Triploidy ...............................pptx
Triploidy ...............................pptxTriploidy ...............................pptx
Triploidy ...............................pptxCherry
 
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 RpWASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 RpSérgio Sacani
 
GBSN - Microbiology Lab 2 (Compound Microscope)
GBSN - Microbiology Lab 2 (Compound Microscope)GBSN - Microbiology Lab 2 (Compound Microscope)
GBSN - Microbiology Lab 2 (Compound Microscope)Areesha Ahmad
 
ERTHROPOIESIS: Dr. E. Muralinath & R. Gnana Lahari
ERTHROPOIESIS: Dr. E. Muralinath & R. Gnana LahariERTHROPOIESIS: Dr. E. Muralinath & R. Gnana Lahari
ERTHROPOIESIS: Dr. E. Muralinath & R. Gnana Laharimuralinath2
 
Land use land cover change analysis and detection of its drivers using geospa...
Land use land cover change analysis and detection of its drivers using geospa...Land use land cover change analysis and detection of its drivers using geospa...
Land use land cover change analysis and detection of its drivers using geospa...MohammedAhmed246550
 
Jet reorientation in central galaxies of clusters and groups: insights from V...
Jet reorientation in central galaxies of clusters and groups: insights from V...Jet reorientation in central galaxies of clusters and groups: insights from V...
Jet reorientation in central galaxies of clusters and groups: insights from V...Sérgio Sacani
 
Aerodynamics. flippatterncn5tm5ttnj6nmnynyppt
Aerodynamics. flippatterncn5tm5ttnj6nmnynypptAerodynamics. flippatterncn5tm5ttnj6nmnynyppt
Aerodynamics. flippatterncn5tm5ttnj6nmnynypptsreddyrahul
 
GBSN - Microbiology Lab 1 (Microbiology Lab Safety Procedures)
GBSN -  Microbiology Lab  1 (Microbiology Lab Safety Procedures)GBSN -  Microbiology Lab  1 (Microbiology Lab Safety Procedures)
GBSN - Microbiology Lab 1 (Microbiology Lab Safety Procedures)Areesha Ahmad
 

Kürzlich hochgeladen (20)

Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
 
Mitosis...............................pptx
Mitosis...............................pptxMitosis...............................pptx
Mitosis...............................pptx
 
Climate extremes likely to drive land mammal extinction during next supercont...
Climate extremes likely to drive land mammal extinction during next supercont...Climate extremes likely to drive land mammal extinction during next supercont...
Climate extremes likely to drive land mammal extinction during next supercont...
 
Cell Immobilization Methods and Applications.pptx
Cell Immobilization Methods and Applications.pptxCell Immobilization Methods and Applications.pptx
Cell Immobilization Methods and Applications.pptx
 
Hemoglobin metabolism: C Kalyan & E. Muralinath
Hemoglobin metabolism: C Kalyan & E. MuralinathHemoglobin metabolism: C Kalyan & E. Muralinath
Hemoglobin metabolism: C Kalyan & E. Muralinath
 
The solar dynamo begins near the surface
The solar dynamo begins near the surfaceThe solar dynamo begins near the surface
The solar dynamo begins near the surface
 
Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...
Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...
Emergent ribozyme behaviors in oxychlorine brines indicate a unique niche for...
 
Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...
Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...
Alternative method of dissolution in-vitro in-vivo correlation and dissolutio...
 
The Scientific names of some important families of Industrial plants .pdf
The Scientific names of some important families of Industrial plants .pdfThe Scientific names of some important families of Industrial plants .pdf
The Scientific names of some important families of Industrial plants .pdf
 
Tuberculosis (TB)-Notes.pdf microbiology notes
Tuberculosis (TB)-Notes.pdf microbiology notesTuberculosis (TB)-Notes.pdf microbiology notes
Tuberculosis (TB)-Notes.pdf microbiology notes
 
Microbial bio Synthesis of nanoparticles.pptx
Microbial bio Synthesis of nanoparticles.pptxMicrobial bio Synthesis of nanoparticles.pptx
Microbial bio Synthesis of nanoparticles.pptx
 
Plasmapheresis - Dr. E. Muralinath - Kalyan . C.pptx
Plasmapheresis - Dr. E. Muralinath - Kalyan . C.pptxPlasmapheresis - Dr. E. Muralinath - Kalyan . C.pptx
Plasmapheresis - Dr. E. Muralinath - Kalyan . C.pptx
 
Triploidy ...............................pptx
Triploidy ...............................pptxTriploidy ...............................pptx
Triploidy ...............................pptx
 
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 RpWASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
 
GBSN - Microbiology Lab 2 (Compound Microscope)
GBSN - Microbiology Lab 2 (Compound Microscope)GBSN - Microbiology Lab 2 (Compound Microscope)
GBSN - Microbiology Lab 2 (Compound Microscope)
 
ERTHROPOIESIS: Dr. E. Muralinath & R. Gnana Lahari
ERTHROPOIESIS: Dr. E. Muralinath & R. Gnana LahariERTHROPOIESIS: Dr. E. Muralinath & R. Gnana Lahari
ERTHROPOIESIS: Dr. E. Muralinath & R. Gnana Lahari
 
Land use land cover change analysis and detection of its drivers using geospa...
Land use land cover change analysis and detection of its drivers using geospa...Land use land cover change analysis and detection of its drivers using geospa...
Land use land cover change analysis and detection of its drivers using geospa...
 
Jet reorientation in central galaxies of clusters and groups: insights from V...
Jet reorientation in central galaxies of clusters and groups: insights from V...Jet reorientation in central galaxies of clusters and groups: insights from V...
Jet reorientation in central galaxies of clusters and groups: insights from V...
 
Aerodynamics. flippatterncn5tm5ttnj6nmnynyppt
Aerodynamics. flippatterncn5tm5ttnj6nmnynypptAerodynamics. flippatterncn5tm5ttnj6nmnynyppt
Aerodynamics. flippatterncn5tm5ttnj6nmnynyppt
 
GBSN - Microbiology Lab 1 (Microbiology Lab Safety Procedures)
GBSN -  Microbiology Lab  1 (Microbiology Lab Safety Procedures)GBSN -  Microbiology Lab  1 (Microbiology Lab Safety Procedures)
GBSN - Microbiology Lab 1 (Microbiology Lab Safety Procedures)
 

2015.3.12 the root of lisp

  • 1. Text The Root of Lisp Paul Graham Presenter: Ofa Date: 2015.3.12
  • 3. John McCarthy Operators + notation for functions = whole programming language C model vs Lisp model The Euclid for programming!!!
  • 4. Operators Expression = an atom or a list of zero or more expressions Atom: foo List: (), ,(foo bar), (a b (c) d) Value: ex. 1+1=2; 1+1=>e, 2=>v, said e returns v If an e is a list, it can be the form: (operator arguments*) ( ( 1 + 2 ) * 3) ( * ( + 1 2 ) 3 ) Symbolic expression List Atom Number Symbol
  • 5. Operators (quote x) returns x > ‘x x (atom x) returns the atom t if the value of x is an atom or the empty list, otherwise it returns () (falsity) > (atom ‘a) t > (atom ‘(a b c)) () Most distinctive feature of Lisp: Code and data are made out of the same data structures︎ and the quote operator is the way we distinguish between them︎
  • 6. Operators (eq x y) returns t if x and y are the same atom or both the empty list, () otherwise > (eq ‘x ‘x) t (car x) expects the value of x to be a list, and returns the first element of x > (car ‘(a b c) ) a (cdr x) expects the value of x be a list, and returns everything after the first element > (cdr ‘(a b c) ) (b c) (cons x y) expects the value of y to be a list, and returns a list containing the value of x followed by the elements of the value of y > (cons ‘a ‘(b c)) (a b c) > (cdr (cons ‘a ‘(b c)) (b c)
  • 7. Operators (cond (p1 e1)…(pn en) ) the p expressions are evaluated in order until one returns t; when one is found, the value of the corresponding e expression is returned > (cond ( ( eq ‘a ‘b) ‘first) ( ( atom ‘a) ‘second) ) second the same as {key, value} in C styled
  • 8. Function Function call ( ( lambda (p1…pn) e) a1…an) p1 <- e(a1), a1 is evaluated and then e, p1 becomes the corresponding value of a1 > ( ( lambda (x y) (cons( x (cdr y) ) ) ‘z ‘(a b c) ) (z b c)
  • 9. Surprise A function that turns out to be an interpreter of a language?! -> We can define a function that takes as an argument any Lisp expression, and returns its value ref page 8 to see the details
  • 10. Summary Recursion A new concept of variables Garbage-collection Programs composed of expressions The whole language always available Python!!!