SlideShare uma empresa Scribd logo
1 de 42
(A Little  LISP )‏ By James Ladd  http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia WHAT ?
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia The greatest single programming language ever designed. —  Alan Kay
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia John McCarthy Created LISP
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia John McCarthy Recursive Functions of Symbolic Expressions and Their Computation by Machine
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia John McCarthy In 1958 Created LISP
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP <(  )=
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia In  1958
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia 1958
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia In  1958
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia In  1958 C IBM 704 FORTRAN C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION  C INPUT - CARD READER UNIT 5, INTEGER INPUT C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING READ INPUT TAPE 5, 501, IA, IB, IC 501 FORMAT (3I5)‏ C IA, IB, AND IC MAY NOT BE NEGATIVE C FURTHERMORE, THE SUM OF TWO SIDES OF A TRIANGLE C IS GREATER THAN THE THIRD SIDE, SO WE CHECK FOR THAT, TOO IF (IA) 777, 777, 701 701 IF (IB) 777, 777, 702 702 IF (IC) 777, 777, 703 703 IF (IA+IB-IC) 777,777,704 704 IF (IA+IC-IB) 777,777,705 705 IF (IB+IC-IA) 777,777,799 777 STOP 1 C USING HERON'S FORMULA WE CALCULATE THE C AREA OF THE TRIANGLE 799 S = FLOATF (IA + IB + IC) / 2.0 AREA = SQRT( S * (S - FLOATF(IA)) * (S - FLOATF(IB)) * +  (S - FLOATF(IC)))‏ WRITE OUTPUT TAPE 6, 601, IA, IB, IC, AREA 601 FORMAT (4H A= ,I5,5H  B= ,I5,5H  C= ,I5,8H  AREA= ,F10.2,  +  13H SQUARE UNITS)‏ STOP END
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Created LISP as mathematical notation for computer programs
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Based on Lambda Calculus
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Lambda Calculus the function  f(x, y) = x - y  would be written as  λ x. λ y. x - y.
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia List Processing Language   (FOO (BAR 1) 2)‏
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP pioneered:   Tree Data Structures   Automatic Storage Management   Dynamic Typing   Object Oriented Programming
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP pioneered:   Self-hosting Compiler !!
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP = Pure Functional Language
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia FIFTY YEARS AGO
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Functional Programs Are:   Stateless   Deal only with Functions   No side effects in 'state'   Functions can return Functions
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (print &quot;Hello world&quot;)‏
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (defun factorial (n)‏ (if (<= n 1)‏ 1 (* n (factorial (- n 1)))))‏
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (dotimes (i 10)‏   (format t &quot;~A~%&quot; (+ 1 i)))‏
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP is a series of expressions   foo   ()   (foo)‏ (foo bar)   (a b (c) d)‏
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia A LISP expression  Atom  or a  list  of zero or more expressions, separated by whitespace and enclosed in ().
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia F oo = atom   () = empty list   (foo)  = list of one atom (foo bar) = list of two atoms   (a b (c) d) = list of 4 elements,   the 3 rd  one is itself a list.
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia > (+ 1 2) 3 >
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia > (+ 1 (- 10 5)) 6 >
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (quote  x ) returns  x   >(quote a)   a >'a a >(quote (+ 1 2))   (+ 1 2)‏
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (atom  x ) returns  t  if  x   is an atom, otherwise ()   >(atom 'a)   t >(atom '(a b c))‏ ()
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (eq  x y ) returns  t  if  x  and  y  are same atom or both (), otherwise ()   >(eq 'a 'a)  >(eq '() '())   t  t >(eq 'a 'b)‏ ()
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (car  x ) returns first element of value of  x   >(car '(a b c))‏ a   >(car '('(foo) bar baz))‏ (foo)
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cdr  x ) returns everything after the first element of value of  x   >(cdr '(a b c))‏ (b c)   >(cdr '('(foo) bar baz))‏ (bar baz)
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cons  x y ) returns a list containing value of  x  followed by value of  y   >(cons 'a '(b c))‏ (a b c)   >(car (cons 'a '(b c)))‏ (b c)
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cond ( p1 e1 )...( p n  e n )) The  p  expressions are evaluated in order until one returns  t . When one is found, the value of the corresponding  e  expression is returned as the value of the whole cond expression.
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cond ( p1 e1 )...( p n  e n )) >(cond  ((eq 'a 'b) 'first)   ((atom 'a) 'second))‏ second
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cond ( p1 e1 )...( p n  e n ))   (cond  ( x y ) ('t  z ))‏ is equivalent to   if  x  then  y  else  z
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Recommended Reading The Little Lisper ANSI Common Lisp
A Little LISP, By James Ladd  http://www.jamesladdcode.com  with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Some real code ...
 

Mais conteúdo relacionado

Destaque

5 kinesis lightning
5 kinesis lightning5 kinesis lightning
5 kinesis lightningBigDataCamp
 
Microsoft Wpf Silverlight Comparison Whitepaper V1 1
Microsoft Wpf Silverlight Comparison Whitepaper V1 1Microsoft Wpf Silverlight Comparison Whitepaper V1 1
Microsoft Wpf Silverlight Comparison Whitepaper V1 1guest91fb2a
 
مفهوم الضرر بين الشرع والطب
مفهوم الضرر بين الشرع والطبمفهوم الضرر بين الشرع والطب
مفهوم الضرر بين الشرع والطبDr Ghaiath Hussein
 
فرانز كافكا - الآثار الكاملة - الجزء الأول
فرانز كافكا - الآثار الكاملة - الجزء الأولفرانز كافكا - الآثار الكاملة - الجزء الأول
فرانز كافكا - الآثار الكاملة - الجزء الأولA-Ile Self-hallucination
 
Show me your hands
Show me your handsShow me your hands
Show me your handsTerry Penney
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kayeCee Saliendrez
 
Universal Image Loader: Story, Architecture, FAQ
Universal Image Loader: Story, Architecture, FAQUniversal Image Loader: Story, Architecture, FAQ
Universal Image Loader: Story, Architecture, FAQSergey Tarasevich
 

Destaque (13)

5 kinesis lightning
5 kinesis lightning5 kinesis lightning
5 kinesis lightning
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Microsoft Wpf Silverlight Comparison Whitepaper V1 1
Microsoft Wpf Silverlight Comparison Whitepaper V1 1Microsoft Wpf Silverlight Comparison Whitepaper V1 1
Microsoft Wpf Silverlight Comparison Whitepaper V1 1
 
TJOLI
TJOLITJOLI
TJOLI
 
مفهوم الضرر بين الشرع والطب
مفهوم الضرر بين الشرع والطبمفهوم الضرر بين الشرع والطب
مفهوم الضرر بين الشرع والطب
 
ijhff
ijhffijhff
ijhff
 
Dorissss
DorissssDorissss
Dorissss
 
فرانز كافكا - الآثار الكاملة - الجزء الأول
فرانز كافكا - الآثار الكاملة - الجزء الأولفرانز كافكا - الآثار الكاملة - الجزء الأول
فرانز كافكا - الآثار الكاملة - الجزء الأول
 
Show me your hands
Show me your handsShow me your hands
Show me your hands
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kaye
 
Universal Image Loader: Story, Architecture, FAQ
Universal Image Loader: Story, Architecture, FAQUniversal Image Loader: Story, Architecture, FAQ
Universal Image Loader: Story, Architecture, FAQ
 
Visvi
VisviVisvi
Visvi
 
Apuntes
ApuntesApuntes
Apuntes
 

Mais de melbournepatterns (20)

An Introduction to
An Introduction to An Introduction to
An Introduction to
 
State Pattern from GoF
State Pattern from GoFState Pattern from GoF
State Pattern from GoF
 
Iterator Pattern
Iterator PatternIterator Pattern
Iterator Pattern
 
Iterator
IteratorIterator
Iterator
 
Concurrency Patterns
Concurrency PatternsConcurrency Patterns
Concurrency Patterns
 
Continuous Integration, Fast Builds and Flot
Continuous Integration, Fast Builds and FlotContinuous Integration, Fast Builds and Flot
Continuous Integration, Fast Builds and Flot
 
Command Pattern
Command PatternCommand Pattern
Command Pattern
 
Code Contracts API In .Net
Code Contracts API In .NetCode Contracts API In .Net
Code Contracts API In .Net
 
LINQ/PLINQ
LINQ/PLINQLINQ/PLINQ
LINQ/PLINQ
 
Gpu Cuda
Gpu CudaGpu Cuda
Gpu Cuda
 
Facade Pattern
Facade PatternFacade Pattern
Facade Pattern
 
Phani Kumar - Decorator Pattern
Phani Kumar - Decorator PatternPhani Kumar - Decorator Pattern
Phani Kumar - Decorator Pattern
 
Composite Pattern
Composite PatternComposite Pattern
Composite Pattern
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 
Prototype Design Pattern
Prototype Design PatternPrototype Design Pattern
Prototype Design Pattern
 
Factory Method Design Pattern
Factory Method Design PatternFactory Method Design Pattern
Factory Method Design Pattern
 
Abstract Factory Design Pattern
Abstract Factory Design PatternAbstract Factory Design Pattern
Abstract Factory Design Pattern
 
State Pattern in Flex
State Pattern in FlexState Pattern in Flex
State Pattern in Flex
 
Active Object
Active ObjectActive Object
Active Object
 
Extract Composite Talk Andy
Extract Composite Talk AndyExtract Composite Talk Andy
Extract Composite Talk Andy
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

A Little Lisp

  • 1. (A Little LISP )‏ By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia
  • 2. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia WHAT ?
  • 3. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia The greatest single programming language ever designed. — Alan Kay
  • 4. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia John McCarthy Created LISP
  • 5. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia John McCarthy Recursive Functions of Symbolic Expressions and Their Computation by Machine
  • 6. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia John McCarthy In 1958 Created LISP
  • 7. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP <( )=
  • 8. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia In 1958
  • 9. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia 1958
  • 10. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia In 1958
  • 11. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia In 1958 C IBM 704 FORTRAN C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION C INPUT - CARD READER UNIT 5, INTEGER INPUT C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING READ INPUT TAPE 5, 501, IA, IB, IC 501 FORMAT (3I5)‏ C IA, IB, AND IC MAY NOT BE NEGATIVE C FURTHERMORE, THE SUM OF TWO SIDES OF A TRIANGLE C IS GREATER THAN THE THIRD SIDE, SO WE CHECK FOR THAT, TOO IF (IA) 777, 777, 701 701 IF (IB) 777, 777, 702 702 IF (IC) 777, 777, 703 703 IF (IA+IB-IC) 777,777,704 704 IF (IA+IC-IB) 777,777,705 705 IF (IB+IC-IA) 777,777,799 777 STOP 1 C USING HERON'S FORMULA WE CALCULATE THE C AREA OF THE TRIANGLE 799 S = FLOATF (IA + IB + IC) / 2.0 AREA = SQRT( S * (S - FLOATF(IA)) * (S - FLOATF(IB)) * + (S - FLOATF(IC)))‏ WRITE OUTPUT TAPE 6, 601, IA, IB, IC, AREA 601 FORMAT (4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2, + 13H SQUARE UNITS)‏ STOP END
  • 12. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Created LISP as mathematical notation for computer programs
  • 13. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Based on Lambda Calculus
  • 14. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Lambda Calculus the function f(x, y) = x - y would be written as λ x. λ y. x - y.
  • 15. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia
  • 16. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia List Processing Language (FOO (BAR 1) 2)‏
  • 17. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP pioneered: Tree Data Structures Automatic Storage Management Dynamic Typing Object Oriented Programming
  • 18. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP pioneered: Self-hosting Compiler !!
  • 19. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP = Pure Functional Language
  • 20. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia FIFTY YEARS AGO
  • 21. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Functional Programs Are: Stateless Deal only with Functions No side effects in 'state' Functions can return Functions
  • 22. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (print &quot;Hello world&quot;)‏
  • 23. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (defun factorial (n)‏ (if (<= n 1)‏ 1 (* n (factorial (- n 1)))))‏
  • 24. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (dotimes (i 10)‏ (format t &quot;~A~%&quot; (+ 1 i)))‏
  • 25. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia LISP is a series of expressions foo () (foo)‏ (foo bar) (a b (c) d)‏
  • 26. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia A LISP expression Atom or a list of zero or more expressions, separated by whitespace and enclosed in ().
  • 27. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia F oo = atom () = empty list (foo) = list of one atom (foo bar) = list of two atoms (a b (c) d) = list of 4 elements, the 3 rd one is itself a list.
  • 28. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia > (+ 1 2) 3 >
  • 29. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia > (+ 1 (- 10 5)) 6 >
  • 30. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (quote x ) returns x >(quote a) a >'a a >(quote (+ 1 2)) (+ 1 2)‏
  • 31. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (atom x ) returns t if x is an atom, otherwise () >(atom 'a) t >(atom '(a b c))‏ ()
  • 32. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (eq x y ) returns t if x and y are same atom or both (), otherwise () >(eq 'a 'a) >(eq '() '()) t t >(eq 'a 'b)‏ ()
  • 33. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (car x ) returns first element of value of x >(car '(a b c))‏ a >(car '('(foo) bar baz))‏ (foo)
  • 34. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cdr x ) returns everything after the first element of value of x >(cdr '(a b c))‏ (b c) >(cdr '('(foo) bar baz))‏ (bar baz)
  • 35. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cons x y ) returns a list containing value of x followed by value of y >(cons 'a '(b c))‏ (a b c) >(car (cons 'a '(b c)))‏ (b c)
  • 36. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia
  • 37. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cond ( p1 e1 )...( p n e n )) The p expressions are evaluated in order until one returns t . When one is found, the value of the corresponding e expression is returned as the value of the whole cond expression.
  • 38. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cond ( p1 e1 )...( p n e n )) >(cond ((eq 'a 'b) 'first) ((atom 'a) 'second))‏ second
  • 39. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia (cond ( p1 e1 )...( p n e n )) (cond ( x y ) ('t z ))‏ is equivalent to if x then y else z
  • 40. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Recommended Reading The Little Lisper ANSI Common Lisp
  • 41. A Little LISP, By James Ladd http://www.jamesladdcode.com with portions from The Roots Of Lisp, by Paul Graham All images © iStockPhoto or Wikipedia Some real code ...
  • 42.