SlideShare a Scribd company logo
Introduction to LISP
Overview AGENDA History Introduction Lisp Features Syntax Comparison structures Lambda expressions Conses and Lists List processing procedures Summary Lisp applications
Lisp was invented by John McCarthy in 1958 while he was at the MIT. McCarthy published its design in a paper in Communications of the ACM in 1960. Lisp was first implemented by Steve Russell on an IBM 704 computer. Connection to AI: Lisp was closely connected to AI research communities, especially on PDP-10 systems. Lisp was used as the implementation of the programming language Micro Planner  which was used in the famous AI system SHRUDLU. Over its fifty-year history, lisp has spawned many variations on the core theme of an S-expression language.  Lisp history
A Lisp machine at the MIT museum
Introduction to Lisp(List processing) Lisp is second oldest  high-level programming languages with a long history and a distinctive, fully parenthesized syntax. Lisp is a Tool to solve some of the most difficult problems in the world of computing. It is an example of elegant, minimalist language. Lisp is one of the most popular programming languages that is used for Artificial intelligence.
Lisp features Built in support for Lists. Atomic storage management. Dynamic Typing Uniform syntax. Interactive environment. Extensibility Standard macros. Special forms(loop, do, dotimes..)
Syntax (Data structures) Lists are surrounded by parenthesis. Ex: (),(()),((a,b,c)),((1,2),3,4) are all Lists. Atoms are string of characters beginning with letter, digit or special characters other than left “(“ and right “)”  Ex: (a b c d) is a list of four elements(atoms) a,b,c,d       Peace        Of        Mind         6678 Prefix notation is followed in Lisp. Operators first, followed by the arguments. Ex: (+ 4 5)  adds 4 to 5       (/ 12 6)2
Function Definition List represents function calls as well as basic data structures. (factorial 4)12 (+4 2)6 Definition of a function (defun <f-name><parameter-list><body>) Ex: (defun square(X)               (*XX))           SQUARE >(square2)4 >(square(square 2))16
Function inside function Ex: (+3(40)6)49       (+3(+3 3)4)13 Addition, subtraction and multiplication process 2*3 36 6
Comparing functions The comparison symbols are( => ,< ,> ,=<, >= ,<= ) These function return either True(T) or Nil. Ex: (= 4 4)T         (< 4 4)NIL         (> 5 1)T         (>= 6 3)T         (<= 4 3)NIL
Other comparison function ,[object Object],Returns TRUE if values are not equal else NIL if values are equal. ,[object Object],Ex: (/4 2) 2 ,[object Object],Ex: (Max -3 3 40 150 -100)150 ,[object Object],Ex: (Min 3 4 10 -5)-5
Assigning functions: Syntax: setq( argument) Ex: (setq a 3)3       (* a 4)12 Explicit evaluation call; (eval a)3 Note: A quoted value is always kept untouched. (setq b ‘(+ a 4))(+ a 4)
4 equality predicates: (=, equal, eq, eql) for numerical values only. Ex: (= 2 4/2) T (setf a (1 2)) (1 2) (setf b (1 2)) (1 2) (equal a b)T (eql 3 9/3)T
Nil represents false and an empty list. Ex: (null nil)T (null())T (null ‘(a b))NIL (not ‘(a b))NIL
Lambda expressions Lambda operator is used to bind variables to values which are then evaluated within an expression. Arguments to lambda are list of arguments, and the expression or expressions to which the function evaluates.  (lambda (arg) (arg+1)) evaluates to the function that, when applied takes one argument , binds it to arg and returns the number one greater then that argument. Ex: (lambda (arg) (arg+1) 4)5
Conses and lists A lisp list is a singly linked list, Each cell of this list is called a Cons, is composed of two pointers, called the car and cdr. If the given cons is taken to be the head of the linked list, then its car points to the first element of the list, and its cdr points to the rest of the List. A variable which refers to the list is simply a pointer to the first cons of the list. Parenthesized  S-expressions represent Linked list structure.
List-processing procedures List can be directly created with the list procedure, which takes any number of arguments and returns the list of these arguments. Ex: (List 1 2 ‘ a 3) ( 1 2 a 3)      (List 1 ‘ (2 3) 4)(1 (2 3) 4) For the linked lists cons procedure can be used to add an element to the front of the list. Ex: (cons 1 ‘ (2 3))(1 2 3) Append procedure append two or more lists to one another. Ex: (append ‘ (1 2) ‘ (3 4))(1 2 3 4)
Basic lisp examples Basic hello world program(print “Hello world”) To evaluate factorial on a number(n) ,[object Object],         (if (<= n 1)              1             (* n (factorial(- n 1))))) //iterative version  which uses common Lisp’s Loop Macro// ,[object Object],         (loop for I from 1 to n             for fac=1 then (* fac i)             finally (return fac))) //using recursive function// ,[object Object],           (let  ((return –value  ‘()))               (dolist  (e list) (push e return-value))                  return-value))
Lisp Summary Simple syntax.  so, its very easy to parse. Programming in Lisp is distinguished from other programming languages due to its unique syntax and development mode. The interchangeability of code and data also gives Lisp instantly recognizable syntax.  All lisp program code is written as S-expressions , or parenthesized lists.
Applications of Lisp programming Common Lisp is used to develop research applications(often in Artificial Intelligence) For rapid development of prototypes Lisp language is often used in interactive command line, which may be combined with an IDE. Common Lisp is used in many commercial applications, Including the Yahoo! Store Web-commerce site. Other visible applications people have developed using Lisp are: ,[object Object]
G2

More Related Content

What's hot

LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
DataminingTools Inc
 
Introduction to Programming in LISP
Introduction to Programming in LISPIntroduction to Programming in LISP
Introduction to Programming in LISP
Knoldus Inc.
 
Lisp
LispLisp
Gentle Introduction To Lisp
Gentle Introduction To LispGentle Introduction To Lisp
Gentle Introduction To Lisp
Damien Garaud
 
Lisp
LispLisp
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming Languge
Yaser Jaradeh
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
Devnology
 
Basic lisp
Basic lispBasic lisp
Basic lisp
Arvind sahu
 
Lecture11 syntax analysis_7
Lecture11 syntax analysis_7Lecture11 syntax analysis_7
Lecture11 syntax analysis_7
Mahesh Kumar Chelimilla
 
Functional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative ProgrammersFunctional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative Programmers
Chris
 
Compiler Design LR parsing SLR ,LALR CLR
Compiler Design LR parsing SLR ,LALR CLRCompiler Design LR parsing SLR ,LALR CLR
Compiler Design LR parsing SLR ,LALR CLR
Riazul Islam
 
Bottom - Up Parsing
Bottom - Up ParsingBottom - Up Parsing
Bottom - Up Parsing
kunj desai
 
Scheme language
Scheme languageScheme language
Scheme language
JITENDRA LENKA
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
R Islam
 
COMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax AnalysisCOMPILER DESIGN- Syntax Analysis
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
Vipul Naik
 
Scheme Programming Language
Scheme Programming LanguageScheme Programming Language
Scheme Programming Language
Reham AlBlehid
 
Optimization of dfa
Optimization of dfaOptimization of dfa
Optimization of dfa
Kiran Acharya
 
Back patching
Back patchingBack patching
Back patching
santhiya thavanthi
 

What's hot (20)

LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
 
Introduction to Programming in LISP
Introduction to Programming in LISPIntroduction to Programming in LISP
Introduction to Programming in LISP
 
Lisp
LispLisp
Lisp
 
Prolog & lisp
Prolog & lispProlog & lisp
Prolog & lisp
 
Gentle Introduction To Lisp
Gentle Introduction To LispGentle Introduction To Lisp
Gentle Introduction To Lisp
 
Lisp
LispLisp
Lisp
 
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming Languge
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Basic lisp
Basic lispBasic lisp
Basic lisp
 
Lecture11 syntax analysis_7
Lecture11 syntax analysis_7Lecture11 syntax analysis_7
Lecture11 syntax analysis_7
 
Functional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative ProgrammersFunctional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative Programmers
 
Compiler Design LR parsing SLR ,LALR CLR
Compiler Design LR parsing SLR ,LALR CLRCompiler Design LR parsing SLR ,LALR CLR
Compiler Design LR parsing SLR ,LALR CLR
 
Bottom - Up Parsing
Bottom - Up ParsingBottom - Up Parsing
Bottom - Up Parsing
 
Scheme language
Scheme languageScheme language
Scheme language
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
 
COMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax AnalysisCOMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax Analysis
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 
Scheme Programming Language
Scheme Programming LanguageScheme Programming Language
Scheme Programming Language
 
Optimization of dfa
Optimization of dfaOptimization of dfa
Optimization of dfa
 
Back patching
Back patchingBack patching
Back patching
 

Viewers also liked

Pitching Lovecraft
Pitching LovecraftPitching Lovecraft
Pitching Lovecraft
miker71
 
Beautiful Picture
Beautiful PictureBeautiful Picture
Beautiful Picturesam ran
 
Petitions stellungnahme -beilage_2_komitee
Petitions stellungnahme -beilage_2_komiteePetitions stellungnahme -beilage_2_komitee
Petitions stellungnahme -beilage_2_komitee
Chemtrails Spoter
 
A3 electrical AUDI A3 1997 2000 1.8 20V 4ADR
A3 electrical AUDI A3  1997 2000 1.8 20V 4ADRA3 electrical AUDI A3  1997 2000 1.8 20V 4ADR
A3 electrical AUDI A3 1997 2000 1.8 20V 4ADR
Gherghescu Gabriel
 
M-CARE newsletter 6
M-CARE newsletter 6M-CARE newsletter 6
M-CARE newsletter 6
Karel Van Isacker
 
MMV Programbeskrivelse 2016-1 SDU
MMV Programbeskrivelse 2016-1 SDUMMV Programbeskrivelse 2016-1 SDU
MMV Programbeskrivelse 2016-1 SDUJens Eybye
 
Ana maria jaimes moreno
Ana maria jaimes morenoAna maria jaimes moreno
Ana maria jaimes morenoanita9m
 
Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)
Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)
Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)quetxCB
 
Guia de aprendizaje diagnostico
Guia de aprendizaje  diagnosticoGuia de aprendizaje  diagnostico
Guia de aprendizaje diagnostico
samy meza alvarez
 
Для родителей
Для родителейДля родителей
Для родителей
Татьяна Левчук
 
Glói geimvera
Glói geimveraGlói geimvera
Glói geimvera
nemandi
 
Todo esta bien
Todo esta bienTodo esta bien
Todo esta bien
zkaterin
 
Jornada VII - Informática -CRUV
Jornada VII - Informática -CRUVJornada VII - Informática -CRUV
Jornada VII - Informática -CRUV
Diego
 
Blogs
BlogsBlogs
BlogsJota
 
Bearing witness to yahapalanaya
Bearing witness to yahapalanayaBearing witness to yahapalanaya
Bearing witness to yahapalanaya
Sanjana Hattotuwa
 
Humor y valor (en situaciones de discapacidad).
Humor y valor (en situaciones de discapacidad).Humor y valor (en situaciones de discapacidad).
Humor y valor (en situaciones de discapacidad).
José María
 

Viewers also liked (20)

Pitching Lovecraft
Pitching LovecraftPitching Lovecraft
Pitching Lovecraft
 
Beautiful Picture
Beautiful PictureBeautiful Picture
Beautiful Picture
 
Petitions stellungnahme -beilage_2_komitee
Petitions stellungnahme -beilage_2_komiteePetitions stellungnahme -beilage_2_komitee
Petitions stellungnahme -beilage_2_komitee
 
Escribir en la escuela
Escribir en la escuelaEscribir en la escuela
Escribir en la escuela
 
RIA - RDA - ROA
RIA - RDA - ROARIA - RDA - ROA
RIA - RDA - ROA
 
A3 electrical AUDI A3 1997 2000 1.8 20V 4ADR
A3 electrical AUDI A3  1997 2000 1.8 20V 4ADRA3 electrical AUDI A3  1997 2000 1.8 20V 4ADR
A3 electrical AUDI A3 1997 2000 1.8 20V 4ADR
 
M-CARE newsletter 6
M-CARE newsletter 6M-CARE newsletter 6
M-CARE newsletter 6
 
MMV Programbeskrivelse 2016-1 SDU
MMV Programbeskrivelse 2016-1 SDUMMV Programbeskrivelse 2016-1 SDU
MMV Programbeskrivelse 2016-1 SDU
 
Ana maria jaimes moreno
Ana maria jaimes morenoAna maria jaimes moreno
Ana maria jaimes moreno
 
Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)
Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)
Entrevista a Clare Allcard a La Vanguardia (30 desembre 2013)
 
Guia de aprendizaje diagnostico
Guia de aprendizaje  diagnosticoGuia de aprendizaje  diagnostico
Guia de aprendizaje diagnostico
 
Для родителей
Для родителейДля родителей
Для родителей
 
Glói geimvera
Glói geimveraGlói geimvera
Glói geimvera
 
Todo esta bien
Todo esta bienTodo esta bien
Todo esta bien
 
Jornada VII - Informática -CRUV
Jornada VII - Informática -CRUVJornada VII - Informática -CRUV
Jornada VII - Informática -CRUV
 
Tecnologia
TecnologiaTecnologia
Tecnologia
 
Blogs
BlogsBlogs
Blogs
 
Boletim 145
Boletim 145   Boletim 145
Boletim 145
 
Bearing witness to yahapalanaya
Bearing witness to yahapalanayaBearing witness to yahapalanaya
Bearing witness to yahapalanaya
 
Humor y valor (en situaciones de discapacidad).
Humor y valor (en situaciones de discapacidad).Humor y valor (en situaciones de discapacidad).
Humor y valor (en situaciones de discapacidad).
 

Similar to LISP: Introduction To Lisp

AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
prakashvs7
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
Luis Goldster
 
15 functional programming
15 functional programming15 functional programming
15 functional programmingjigeno
 
15 functional programming
15 functional programming15 functional programming
15 functional programmingjigeno
 
Basic and logical implementation of r language
Basic and logical implementation of r language Basic and logical implementation of r language
Basic and logical implementation of r language Md. Mahedi Mahfuj
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
appasami
 
Lecture 2 lisp-Overview
Lecture 2 lisp-OverviewLecture 2 lisp-Overview
Functional Programming Languages slidesslies.ppt
Functional Programming Languages slidesslies.pptFunctional Programming Languages slidesslies.ppt
Functional Programming Languages slidesslies.ppt
BikalAdhikari4
 
Morel, a data-parallel programming language
Morel, a data-parallel programming languageMorel, a data-parallel programming language
Morel, a data-parallel programming language
Julian Hyde
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
Albert Bifet
 
Python Basics
Python BasicsPython Basics
Python Basics
tusharpanda88
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
NareshKarela1
 
Programming in Scala - Lecture Two
Programming in Scala - Lecture TwoProgramming in Scala - Lecture Two
Programming in Scala - Lecture Two
Angelo Corsaro
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
Dr. Muhammad Ali Tirmizi., Ph.D.
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
rajalakshmi5921
 
CSC8503 Principles of Programming Languages Semester 1, 2015.docx
CSC8503 Principles of Programming Languages Semester 1, 2015.docxCSC8503 Principles of Programming Languages Semester 1, 2015.docx
CSC8503 Principles of Programming Languages Semester 1, 2015.docx
faithxdunce63732
 
Ch-8.pdf
Ch-8.pdfCh-8.pdf
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query Language
Julian Hyde
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
Amr Rashed
 
Functional Programming by Examples using Haskell
Functional Programming by Examples using HaskellFunctional Programming by Examples using Haskell
Functional Programming by Examples using Haskell
goncharenko
 

Similar to LISP: Introduction To Lisp (20)

AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
 
15 functional programming
15 functional programming15 functional programming
15 functional programming
 
15 functional programming
15 functional programming15 functional programming
15 functional programming
 
Basic and logical implementation of r language
Basic and logical implementation of r language Basic and logical implementation of r language
Basic and logical implementation of r language
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
 
Lecture 2 lisp-Overview
Lecture 2 lisp-OverviewLecture 2 lisp-Overview
Lecture 2 lisp-Overview
 
Functional Programming Languages slidesslies.ppt
Functional Programming Languages slidesslies.pptFunctional Programming Languages slidesslies.ppt
Functional Programming Languages slidesslies.ppt
 
Morel, a data-parallel programming language
Morel, a data-parallel programming languageMorel, a data-parallel programming language
Morel, a data-parallel programming language
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
 
Python Basics
Python BasicsPython Basics
Python Basics
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
 
Programming in Scala - Lecture Two
Programming in Scala - Lecture TwoProgramming in Scala - Lecture Two
Programming in Scala - Lecture Two
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
 
CSC8503 Principles of Programming Languages Semester 1, 2015.docx
CSC8503 Principles of Programming Languages Semester 1, 2015.docxCSC8503 Principles of Programming Languages Semester 1, 2015.docx
CSC8503 Principles of Programming Languages Semester 1, 2015.docx
 
Ch-8.pdf
Ch-8.pdfCh-8.pdf
Ch-8.pdf
 
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query Language
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Functional Programming by Examples using Haskell
Functional Programming by Examples using HaskellFunctional Programming by Examples using Haskell
Functional Programming by Examples using Haskell
 

More from LISP Content

LISP: Control Structures In Lisp
LISP: Control Structures In LispLISP: Control Structures In Lisp
LISP: Control Structures In Lisp
LISP Content
 
LISP:Declarations In Lisp
LISP:Declarations In LispLISP:Declarations In Lisp
LISP:Declarations In Lisp
LISP Content
 
LISP: Errors In Lisp
LISP: Errors In LispLISP: Errors In Lisp
LISP: Errors In Lisp
LISP Content
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
LISP Content
 
LISP: Object Sytstem Lisp
LISP: Object Sytstem LispLISP: Object Sytstem Lisp
LISP: Object Sytstem Lisp
LISP Content
 
LISP: Loops In Lisp
LISP: Loops In LispLISP: Loops In Lisp
LISP: Loops In Lisp
LISP Content
 
LISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers in lisp
LISP Content
 
LISP: Symbols and packages in lisp
LISP: Symbols and packages in lispLISP: Symbols and packages in lisp
LISP: Symbols and packages in lisp
LISP Content
 
LISP: Scope and extent in lisp
LISP: Scope and extent in lispLISP: Scope and extent in lisp
LISP: Scope and extent in lisp
LISP Content
 
LISP: Program structure in lisp
LISP: Program structure in lispLISP: Program structure in lisp
LISP: Program structure in lisp
LISP Content
 
LISP: Predicates in lisp
LISP: Predicates in lispLISP: Predicates in lisp
LISP: Predicates in lisp
LISP Content
 
LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
LISP Content
 
LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
LISP Content
 

More from LISP Content (13)

LISP: Control Structures In Lisp
LISP: Control Structures In LispLISP: Control Structures In Lisp
LISP: Control Structures In Lisp
 
LISP:Declarations In Lisp
LISP:Declarations In LispLISP:Declarations In Lisp
LISP:Declarations In Lisp
 
LISP: Errors In Lisp
LISP: Errors In LispLISP: Errors In Lisp
LISP: Errors In Lisp
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
LISP: Object Sytstem Lisp
LISP: Object Sytstem LispLISP: Object Sytstem Lisp
LISP: Object Sytstem Lisp
 
LISP: Loops In Lisp
LISP: Loops In LispLISP: Loops In Lisp
LISP: Loops In Lisp
 
LISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers in lisp
 
LISP: Symbols and packages in lisp
LISP: Symbols and packages in lispLISP: Symbols and packages in lisp
LISP: Symbols and packages in lisp
 
LISP: Scope and extent in lisp
LISP: Scope and extent in lispLISP: Scope and extent in lisp
LISP: Scope and extent in lisp
 
LISP: Program structure in lisp
LISP: Program structure in lispLISP: Program structure in lisp
LISP: Program structure in lisp
 
LISP: Predicates in lisp
LISP: Predicates in lispLISP: Predicates in lisp
LISP: Predicates in lisp
 
LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
 
LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

LISP: Introduction To Lisp

  • 2. Overview AGENDA History Introduction Lisp Features Syntax Comparison structures Lambda expressions Conses and Lists List processing procedures Summary Lisp applications
  • 3. Lisp was invented by John McCarthy in 1958 while he was at the MIT. McCarthy published its design in a paper in Communications of the ACM in 1960. Lisp was first implemented by Steve Russell on an IBM 704 computer. Connection to AI: Lisp was closely connected to AI research communities, especially on PDP-10 systems. Lisp was used as the implementation of the programming language Micro Planner which was used in the famous AI system SHRUDLU. Over its fifty-year history, lisp has spawned many variations on the core theme of an S-expression language. Lisp history
  • 4. A Lisp machine at the MIT museum
  • 5. Introduction to Lisp(List processing) Lisp is second oldest high-level programming languages with a long history and a distinctive, fully parenthesized syntax. Lisp is a Tool to solve some of the most difficult problems in the world of computing. It is an example of elegant, minimalist language. Lisp is one of the most popular programming languages that is used for Artificial intelligence.
  • 6. Lisp features Built in support for Lists. Atomic storage management. Dynamic Typing Uniform syntax. Interactive environment. Extensibility Standard macros. Special forms(loop, do, dotimes..)
  • 7. Syntax (Data structures) Lists are surrounded by parenthesis. Ex: (),(()),((a,b,c)),((1,2),3,4) are all Lists. Atoms are string of characters beginning with letter, digit or special characters other than left “(“ and right “)” Ex: (a b c d) is a list of four elements(atoms) a,b,c,d Peace Of Mind 6678 Prefix notation is followed in Lisp. Operators first, followed by the arguments. Ex: (+ 4 5)  adds 4 to 5 (/ 12 6)2
  • 8. Function Definition List represents function calls as well as basic data structures. (factorial 4)12 (+4 2)6 Definition of a function (defun <f-name><parameter-list><body>) Ex: (defun square(X) (*XX)) SQUARE >(square2)4 >(square(square 2))16
  • 9. Function inside function Ex: (+3(40)6)49 (+3(+3 3)4)13 Addition, subtraction and multiplication process 2*3 36 6
  • 10. Comparing functions The comparison symbols are( => ,< ,> ,=<, >= ,<= ) These function return either True(T) or Nil. Ex: (= 4 4)T (< 4 4)NIL (> 5 1)T (>= 6 3)T (<= 4 3)NIL
  • 11.
  • 12. Assigning functions: Syntax: setq( argument) Ex: (setq a 3)3 (* a 4)12 Explicit evaluation call; (eval a)3 Note: A quoted value is always kept untouched. (setq b ‘(+ a 4))(+ a 4)
  • 13. 4 equality predicates: (=, equal, eq, eql) for numerical values only. Ex: (= 2 4/2) T (setf a (1 2)) (1 2) (setf b (1 2)) (1 2) (equal a b)T (eql 3 9/3)T
  • 14. Nil represents false and an empty list. Ex: (null nil)T (null())T (null ‘(a b))NIL (not ‘(a b))NIL
  • 15. Lambda expressions Lambda operator is used to bind variables to values which are then evaluated within an expression. Arguments to lambda are list of arguments, and the expression or expressions to which the function evaluates. (lambda (arg) (arg+1)) evaluates to the function that, when applied takes one argument , binds it to arg and returns the number one greater then that argument. Ex: (lambda (arg) (arg+1) 4)5
  • 16. Conses and lists A lisp list is a singly linked list, Each cell of this list is called a Cons, is composed of two pointers, called the car and cdr. If the given cons is taken to be the head of the linked list, then its car points to the first element of the list, and its cdr points to the rest of the List. A variable which refers to the list is simply a pointer to the first cons of the list. Parenthesized S-expressions represent Linked list structure.
  • 17. List-processing procedures List can be directly created with the list procedure, which takes any number of arguments and returns the list of these arguments. Ex: (List 1 2 ‘ a 3) ( 1 2 a 3) (List 1 ‘ (2 3) 4)(1 (2 3) 4) For the linked lists cons procedure can be used to add an element to the front of the list. Ex: (cons 1 ‘ (2 3))(1 2 3) Append procedure append two or more lists to one another. Ex: (append ‘ (1 2) ‘ (3 4))(1 2 3 4)
  • 18.
  • 19. Lisp Summary Simple syntax. so, its very easy to parse. Programming in Lisp is distinguished from other programming languages due to its unique syntax and development mode. The interchangeability of code and data also gives Lisp instantly recognizable syntax. All lisp program code is written as S-expressions , or parenthesized lists.
  • 20.
  • 21. G2
  • 23.