SlideShare uma empresa Scribd logo
1 de 10
Baixar para ler offline
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!!!

Mais conteúdo relacionado

Mais procurados

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é
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

Introduction of DNA analysis in Forensic's .pptx
Introduction of DNA analysis in Forensic's .pptxIntroduction of DNA analysis in Forensic's .pptx
Introduction of DNA analysis in Forensic's .pptxrohankumarsinghrore1
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Silpa
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticssakshisoni2385
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)Areesha Ahmad
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsSérgio Sacani
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professormuralinath2
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .Poonam Aher Patil
 
Velocity and Acceleration PowerPoint.ppt
Velocity and Acceleration PowerPoint.pptVelocity and Acceleration PowerPoint.ppt
Velocity and Acceleration PowerPoint.pptRakeshMohan42
 
Dr. E. Muralinath_ Blood indices_clinical aspects
Dr. E. Muralinath_ Blood indices_clinical  aspectsDr. E. Muralinath_ Blood indices_clinical  aspects
Dr. E. Muralinath_ Blood indices_clinical aspectsmuralinath2
 
300003-World Science Day For Peace And Development.pptx
300003-World Science Day For Peace And Development.pptx300003-World Science Day For Peace And Development.pptx
300003-World Science Day For Peace And Development.pptxryanrooker
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxSuji236384
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceAlex Henderson
 
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptxClimate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptxDiariAli
 
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIACURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIADr. TATHAGAT KHOBRAGADE
 
An introduction on sequence tagged site mapping
An introduction on sequence tagged site mappingAn introduction on sequence tagged site mapping
An introduction on sequence tagged site mappingadibshanto115
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learninglevieagacer
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)Areesha Ahmad
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Silpa
 

Último (20)

Introduction of DNA analysis in Forensic's .pptx
Introduction of DNA analysis in Forensic's .pptxIntroduction of DNA analysis in Forensic's .pptx
Introduction of DNA analysis in Forensic's .pptx
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICEPATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
Velocity and Acceleration PowerPoint.ppt
Velocity and Acceleration PowerPoint.pptVelocity and Acceleration PowerPoint.ppt
Velocity and Acceleration PowerPoint.ppt
 
Dr. E. Muralinath_ Blood indices_clinical aspects
Dr. E. Muralinath_ Blood indices_clinical  aspectsDr. E. Muralinath_ Blood indices_clinical  aspects
Dr. E. Muralinath_ Blood indices_clinical aspects
 
300003-World Science Day For Peace And Development.pptx
300003-World Science Day For Peace And Development.pptx300003-World Science Day For Peace And Development.pptx
300003-World Science Day For Peace And Development.pptx
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical Science
 
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptxClimate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
 
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIACURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
 
An introduction on sequence tagged site mapping
An introduction on sequence tagged site mappingAn introduction on sequence tagged site mapping
An introduction on sequence tagged site mapping
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
 

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!!!