19IFTE063
19IFTE073
FUNCTIONAL PROGRAMMING
LANGUAGES IN LISP
HISTORY OF LISP LANGUAGE
John Mccarthy
• A computer programming language
• Mathematical theory
• Functional Applied to data
• EXAMPLE: (+a(*bc))=a+b*c
• Uses the list structure
• Common language for AI
• Second Oldest High Level programming language
• Three basic building blocks(Atom, List, String)
LISP FEATURES
•S-expressionas the universaldata type
•FunctionalProgrammingstyle
•Uniform Representation of data andcode
•Relianceon Recursion
•GarbageCollection
•Machine Independent
•Specialforms
•Advanced oop A lisp machine at the MIT museum
EXAMPLE OF LISP
• TO Find the Maximum number of three using LISP
(defun max 3(a b c)
(cond((> a b)(cond((>a c)a)
(t c)))
((>b c)b)
(t c)))
Output
max3(2 3 4)
4
ADVANTAGES AND
DISADVANTAGES
• Easy to test
• Portable
• Syntax and semantics
• Modules
• Flexible
• Recursion
• Execution of other
programs
• Interaction
• Lack of popularity
• Limited Availability
• Requires multiple
interpreter
• Small install base
• Hard to learn
• Other programmers
make fun
ADVANTAGES DISADVANTAGES
APPLICATIONS OF LISP
• Artificial Intelligence
• AI Robots
• Computer Games
• Pattern Recognition
• Air defence system(Implementation)
• Commercial Application
• Interactive command line
• Tree Traversal
• List Handling and Processing

Principles of programming languages(Functional programming Languages using LISP)

  • 1.
  • 2.
    HISTORY OF LISPLANGUAGE John Mccarthy • A computer programming language • Mathematical theory • Functional Applied to data • EXAMPLE: (+a(*bc))=a+b*c • Uses the list structure • Common language for AI • Second Oldest High Level programming language • Three basic building blocks(Atom, List, String)
  • 3.
    LISP FEATURES •S-expressionas theuniversaldata type •FunctionalProgrammingstyle •Uniform Representation of data andcode •Relianceon Recursion •GarbageCollection •Machine Independent •Specialforms •Advanced oop A lisp machine at the MIT museum
  • 4.
    EXAMPLE OF LISP •TO Find the Maximum number of three using LISP (defun max 3(a b c) (cond((> a b)(cond((>a c)a) (t c))) ((>b c)b) (t c))) Output max3(2 3 4) 4
  • 5.
    ADVANTAGES AND DISADVANTAGES • Easyto test • Portable • Syntax and semantics • Modules • Flexible • Recursion • Execution of other programs • Interaction • Lack of popularity • Limited Availability • Requires multiple interpreter • Small install base • Hard to learn • Other programmers make fun ADVANTAGES DISADVANTAGES
  • 6.
    APPLICATIONS OF LISP •Artificial Intelligence • AI Robots • Computer Games • Pattern Recognition • Air defence system(Implementation) • Commercial Application • Interactive command line • Tree Traversal • List Handling and Processing