SlideShare a Scribd company logo
How to convert into cellcious to the Fahrenheit in lisp
programming?
Formulae=5/9(f-32)
Solution:
(defun convert(c)(* (- c 32)(/ 5 9)))
Solution:
(defun convert(f)(+ (* (/ 9 5)f)))
Lisp in Small Parts
Search
Introduction
 Debugging in LispWorks
Getting Started
 Lists
 Expressions
 Defining Procedures
 Variables
 Manipulating Lists
 Strings
 Printing
 Testing a Result
 Creating Dialogue Boxes
Writing Programs
 Processing Items in a List
 Repeating Operations
 More about Recursion
 Generalising Procedures
Projects
 Animals
 Anagrams
 Recipes
 Map
 Turtle Graphics
 Logic Mazes
 Number Countdown
Answers to Exercises
Index of Procedures

Suggested sites
Answers to Exercises
Not all the exercises have answers yet.
Lists
1.
(list 1 (list 2 (list 3 4)))
Expressions
Defining Procedures
1. Square a number
(defun square (number)
(* number number))
2. Find the nth triangular number
(defun triangular (n)
(/ (* n (+ n 1)) 2))
3. Find the result of throwing two dice
(defun two-dice ()
(+ (+ 1 (random 6)) (+ 1 (random 6))))
Variables
1. Convert between km and miles
(defparameter kilometresinmiles 0.621371192)
(defun convert-km (km)
(* km kilometresinmiles))
(defun convert-miles (miles)
(/ miles kilometresinmiles))
2. Find the average of three numbers
(defun average3 (number1 number2 number3)
(/ (+ number1 number2 number3) 3))
3. Cube the sum of two numbers
(defun cubesum (a b)
(let* ((total (+ a b))
(answer (* total total total)))
answer))
4. Substitute values into a quadratic equation
(defun pseudo-primes (x)
(+ (- (* x x) x) 41))
Manipulating Lists
1. Swap the first two items in a list
(defun swap (lst)
(cons (second lst) (cons (first lst) (rest (rest lst)))))
2. Duplicate the first item in a list
(defun dup (lst)
(cons (first lst) lst))
3. Return a random item from a list
(defun random-elt (lst)
(nth (random (length lst)) lst))
4. Return the last item in a list
(defun last-elt (lst)
(nth (- (length lst) 1) lst))
Strings
Ad

More Related Content

What's hot (20)

Functions
Functions Functions
Functions
Tyler Murphy
 
L3 functions operations
L3 functions operationsL3 functions operations
L3 functions operations
James Tagara
 
Log summary & equations
Log summary & equationsLog summary & equations
Log summary & equations
rouwejan
 
Merge sort code in C explained
Merge sort code in C explained Merge sort code in C explained
Merge sort code in C explained
Mohit Tare
 
5 4 function notation
5 4 function notation5 4 function notation
5 4 function notation
hisema01
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
mohanrathod18
 
Function Basics Math Wiki
Function Basics   Math WikiFunction Basics   Math Wiki
Function Basics Math Wiki
Alec Kargodorian
 
Day 1 examples new
Day 1 examples newDay 1 examples new
Day 1 examples new
jchartiersjsd
 
Chapter 22 Finite Field
Chapter 22 Finite FieldChapter 22 Finite Field
Chapter 22 Finite Field
Tony Cervera Jr.
 
2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list
kinan keshkeh
 
function
 function function
function
Taylor's College, Subang jaya
 
Ch04
Ch04Ch04
Ch04
Hankyo
 
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
Mumbai B.Sc.IT Study
 
Lec9
Lec9Lec9
Lec9
Nikhil Chilwant
 
4R2012 preTest10A
4R2012 preTest10A4R2012 preTest10A
4R2012 preTest10A
A Jorge Garcia
 
Lec23
Lec23Lec23
Lec23
Anjneya Varshney
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
Kevin Jadiya
 
one main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersone main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to others
Ajay Chimmani
 
10 modtab
10 modtab10 modtab
10 modtab
Hanibei
 
computer notes - Data Structures - 26
computer notes - Data Structures - 26computer notes - Data Structures - 26
computer notes - Data Structures - 26
ecomputernotes
 
L3 functions operations
L3 functions operationsL3 functions operations
L3 functions operations
James Tagara
 
Log summary & equations
Log summary & equationsLog summary & equations
Log summary & equations
rouwejan
 
Merge sort code in C explained
Merge sort code in C explained Merge sort code in C explained
Merge sort code in C explained
Mohit Tare
 
5 4 function notation
5 4 function notation5 4 function notation
5 4 function notation
hisema01
 
2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list
kinan keshkeh
 
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
Mumbai B.Sc.IT Study
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
Kevin Jadiya
 
one main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersone main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to others
Ajay Chimmani
 
10 modtab
10 modtab10 modtab
10 modtab
Hanibei
 
computer notes - Data Structures - 26
computer notes - Data Structures - 26computer notes - Data Structures - 26
computer notes - Data Structures - 26
ecomputernotes
 

Similar to Lisp programming (20)

LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
DataminingTools Inc
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
LISP Content
 
Annotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithmAnnotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithm
johnathangamal27
 
phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2
Bui Loi
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
Philip Schwarz
 
Difference of two squares.pptx
Difference of two squares.pptxDifference of two squares.pptx
Difference of two squares.pptx
GeraldineArig2
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
Philip Schwarz
 
Math 116 pres. 1
Math 116 pres. 1Math 116 pres. 1
Math 116 pres. 1
United Scholars Organization (LDCU)
 
Colour in Mathematics Colleen Young July 2021
Colour in Mathematics Colleen Young July 2021Colour in Mathematics Colleen Young July 2021
Colour in Mathematics Colleen Young July 2021
Colleen Young
 
Unit 8(rational expressions) week 22 - simplifying rational expressions
Unit 8(rational expressions)   week 22 - simplifying rational expressionsUnit 8(rational expressions)   week 22 - simplifying rational expressions
Unit 8(rational expressions) week 22 - simplifying rational expressions
Jason Morgan
 
dynamic programming Rod cutting class
dynamic programming Rod cutting classdynamic programming Rod cutting class
dynamic programming Rod cutting class
giridaroori
 
Goldie chapter 4 function
Goldie chapter 4 functionGoldie chapter 4 function
Goldie chapter 4 function
Sarah Sue Calbio
 
Ch8a
Ch8aCh8a
Ch8a
kinnarshah8888
 
Module For Mathematics
Module For Mathematics Module For Mathematics
Module For Mathematics
jrbt2014
 
College Algebra MATH 107Record your answers and work on th.docx
College Algebra MATH 107Record your answers and work on th.docxCollege Algebra MATH 107Record your answers and work on th.docx
College Algebra MATH 107Record your answers and work on th.docx
clarebernice
 
Functional Programming by Examples using Haskell
Functional Programming by Examples using HaskellFunctional Programming by Examples using Haskell
Functional Programming by Examples using Haskell
goncharenko
 
Chapter 4 ds
Chapter 4 dsChapter 4 ds
Chapter 4 ds
Hanif Durad
 
Scheme language
Scheme languageScheme language
Scheme language
JITENDRA LENKA
 
lecture4-recursion.pptx
lecture4-recursion.pptxlecture4-recursion.pptx
lecture4-recursion.pptx
Lizhen Shi
 
Lisp tutorial
Lisp tutorialLisp tutorial
Lisp tutorial
Nilt1234
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
LISP Content
 
Annotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithmAnnotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithm
johnathangamal27
 
phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2
Bui Loi
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
Philip Schwarz
 
Difference of two squares.pptx
Difference of two squares.pptxDifference of two squares.pptx
Difference of two squares.pptx
GeraldineArig2
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
Philip Schwarz
 
Colour in Mathematics Colleen Young July 2021
Colour in Mathematics Colleen Young July 2021Colour in Mathematics Colleen Young July 2021
Colour in Mathematics Colleen Young July 2021
Colleen Young
 
Unit 8(rational expressions) week 22 - simplifying rational expressions
Unit 8(rational expressions)   week 22 - simplifying rational expressionsUnit 8(rational expressions)   week 22 - simplifying rational expressions
Unit 8(rational expressions) week 22 - simplifying rational expressions
Jason Morgan
 
dynamic programming Rod cutting class
dynamic programming Rod cutting classdynamic programming Rod cutting class
dynamic programming Rod cutting class
giridaroori
 
Module For Mathematics
Module For Mathematics Module For Mathematics
Module For Mathematics
jrbt2014
 
College Algebra MATH 107Record your answers and work on th.docx
College Algebra MATH 107Record your answers and work on th.docxCollege Algebra MATH 107Record your answers and work on th.docx
College Algebra MATH 107Record your answers and work on th.docx
clarebernice
 
Functional Programming by Examples using Haskell
Functional Programming by Examples using HaskellFunctional Programming by Examples using Haskell
Functional Programming by Examples using Haskell
goncharenko
 
lecture4-recursion.pptx
lecture4-recursion.pptxlecture4-recursion.pptx
lecture4-recursion.pptx
Lizhen Shi
 
Lisp tutorial
Lisp tutorialLisp tutorial
Lisp tutorial
Nilt1234
 
Ad

More from ilias ahmed (20)

We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...
ilias ahmed
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorial
ilias ahmed
 
Signle assignmentforbciit
Signle assignmentforbciitSignle assignmentforbciit
Signle assignmentforbciit
ilias ahmed
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
ilias ahmed
 
Labreportofai
LabreportofaiLabreportofai
Labreportofai
ilias ahmed
 
Ailabreport
AilabreportAilabreport
Ailabreport
ilias ahmed
 
artificial intelligence
artificial intelligence artificial intelligence
artificial intelligence
ilias ahmed
 
Compiler designs presentation final
Compiler designs presentation  finalCompiler designs presentation  final
Compiler designs presentation final
ilias ahmed
 
Compiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final finalCompiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final final
ilias ahmed
 
Assmemble langauge for slideshare.net
Assmemble langauge for slideshare.netAssmemble langauge for slideshare.net
Assmemble langauge for slideshare.net
ilias ahmed
 
Phpfundamnetalfromtutplus
PhpfundamnetalfromtutplusPhpfundamnetalfromtutplus
Phpfundamnetalfromtutplus
ilias ahmed
 
Assignment complier design (GROUP1)
Assignment complier design (GROUP1)Assignment complier design (GROUP1)
Assignment complier design (GROUP1)
ilias ahmed
 
Lispprograaming excercise
Lispprograaming excerciseLispprograaming excercise
Lispprograaming excercise
ilias ahmed
 
Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)
ilias ahmed
 
Event design
Event designEvent design
Event design
ilias ahmed
 
Vlan
VlanVlan
Vlan
ilias ahmed
 
Data communications
Data communicationsData communications
Data communications
ilias ahmed
 
Microprocessor projec ts
Microprocessor projec tsMicroprocessor projec ts
Microprocessor projec ts
ilias ahmed
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
ilias ahmed
 
Sql functions
Sql functionsSql functions
Sql functions
ilias ahmed
 
We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...
ilias ahmed
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorial
ilias ahmed
 
Signle assignmentforbciit
Signle assignmentforbciitSignle assignmentforbciit
Signle assignmentforbciit
ilias ahmed
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
ilias ahmed
 
artificial intelligence
artificial intelligence artificial intelligence
artificial intelligence
ilias ahmed
 
Compiler designs presentation final
Compiler designs presentation  finalCompiler designs presentation  final
Compiler designs presentation final
ilias ahmed
 
Compiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final finalCompiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final final
ilias ahmed
 
Assmemble langauge for slideshare.net
Assmemble langauge for slideshare.netAssmemble langauge for slideshare.net
Assmemble langauge for slideshare.net
ilias ahmed
 
Phpfundamnetalfromtutplus
PhpfundamnetalfromtutplusPhpfundamnetalfromtutplus
Phpfundamnetalfromtutplus
ilias ahmed
 
Assignment complier design (GROUP1)
Assignment complier design (GROUP1)Assignment complier design (GROUP1)
Assignment complier design (GROUP1)
ilias ahmed
 
Lispprograaming excercise
Lispprograaming excerciseLispprograaming excercise
Lispprograaming excercise
ilias ahmed
 
Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)
ilias ahmed
 
Data communications
Data communicationsData communications
Data communications
ilias ahmed
 
Microprocessor projec ts
Microprocessor projec tsMicroprocessor projec ts
Microprocessor projec ts
ilias ahmed
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
ilias ahmed
 
Ad

Recently uploaded (20)

Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdfAPM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
Association for Project Management
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
Real GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for SuccessReal GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for Success
Mark Soia
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.
MCH
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
Real GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for SuccessReal GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for Success
Mark Soia
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.
MCH
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 

Lisp programming

  • 1. How to convert into cellcious to the Fahrenheit in lisp programming? Formulae=5/9(f-32) Solution: (defun convert(c)(* (- c 32)(/ 5 9))) Solution: (defun convert(f)(+ (* (/ 9 5)f))) Lisp in Small Parts Search Introduction  Debugging in LispWorks Getting Started  Lists  Expressions  Defining Procedures  Variables  Manipulating Lists  Strings  Printing
  • 2.  Testing a Result  Creating Dialogue Boxes Writing Programs  Processing Items in a List  Repeating Operations  More about Recursion  Generalising Procedures Projects  Animals  Anagrams  Recipes  Map  Turtle Graphics  Logic Mazes  Number Countdown Answers to Exercises Index of Procedures  Suggested sites Answers to Exercises Not all the exercises have answers yet. Lists 1. (list 1 (list 2 (list 3 4))) Expressions Defining Procedures 1. Square a number (defun square (number) (* number number)) 2. Find the nth triangular number (defun triangular (n)
  • 3. (/ (* n (+ n 1)) 2)) 3. Find the result of throwing two dice (defun two-dice () (+ (+ 1 (random 6)) (+ 1 (random 6)))) Variables 1. Convert between km and miles (defparameter kilometresinmiles 0.621371192) (defun convert-km (km) (* km kilometresinmiles)) (defun convert-miles (miles) (/ miles kilometresinmiles)) 2. Find the average of three numbers (defun average3 (number1 number2 number3) (/ (+ number1 number2 number3) 3)) 3. Cube the sum of two numbers (defun cubesum (a b) (let* ((total (+ a b)) (answer (* total total total))) answer)) 4. Substitute values into a quadratic equation (defun pseudo-primes (x) (+ (- (* x x) x) 41)) Manipulating Lists 1. Swap the first two items in a list (defun swap (lst) (cons (second lst) (cons (first lst) (rest (rest lst))))) 2. Duplicate the first item in a list (defun dup (lst) (cons (first lst) lst)) 3. Return a random item from a list (defun random-elt (lst) (nth (random (length lst)) lst))
  • 4. 4. Return the last item in a list (defun last-elt (lst) (nth (- (length lst) 1) lst)) Strings