SlideShare a Scribd company logo
Declarations in Lisp
Declarations Declarations allow the user to specify extra information about the program to Lisp system. Declarations are truly optional but special declarations do effect the interpretation of the variable bindings and references and so must be specified wherever necessary. Declarations are one of the good ways to add documentation to the program.
overview Declaration syntax Declaration specifiers Type declaration for forms
Declaration syntax declare construct is used to embed declarations within the executable code. A declare form is known as the declaration. A declaration may occur only at the beginning of the bodies of the certain special forms. declare  {decl-spec}*
Declarations may occur in the lambda expressions and in the forms listed below:
Variable bindings appear only to the bindings made by the form at the head of whose body they appear. (defun foo (x)   (declare (type float x)).. (let  (( x’a)) …) ….)  The type declaration applies only to the outer binding of the x and not to the binding made in the let. The scope of the declaration always includes the body forms, as well as any “stepper” or “result” forms, of the special forms or lambda-expressions. If the declaration applies to a name binding, then the scope of declaration also includes the scope of the name binding.
locally  {declaration}* {form}* This macro is used to make local pervasive declarations where desired. This construct does not bind any variables. Special declaration may be used with lacally to pervasively affect references to, rather than bindings of, variables. The function proclaim takes a decl-spec as its argument and puts it into effect globally.
proclaim decl-spec The proclaim takes decl-spec as the argument and puts it into effect globally. Ex: (proclaim ‘(type float tolerance)) specifies that the dynamic value of the tolerance should always be a floating-point number. A proclaim takes special decl-spec as applying to all bindings as well as to all references of the mentioned variables. This macro is syntactically like declare and semantically like proclaim. It is an executable form and may be used anywhere proclaim may be called. declaim {decl-spec}*
Declaration specifiers List of valid declaration  specifiers for use in declare. (special var1 var2….) specifies that all of the variables named are to be considered special. (type var1, var2,…) affects only variable bindings and specifies that the variables mentioned will take on values only of the specified type.
(ftype type function-name-1, function-name-2,…) specifies that the named functions will be of the function type type. Ex: (declare (ftype(function (integer list) t) nth)                    (ftype (function (number) float) sin cos)) To extend ftype declaration specifiers to accept any function-name, one may write (declaim (ftype (function (list) t) (setf cadr)))
(inline function1, function2,…)specifies that it is desirable for the compiler to open code calls to the specified functions. The compiler is free to ignore this declaration. (notinline function1, function2,…)specifies that it is undesirable for the compiler to compile the specified functions inline. This declaration  is pervasive and the compiler is not free to ignore this declaration. (ignore var1,var2,….) affects only variable bindings and specifies that the bindings of the specified variables are never used. (optimize (quality1 value1) (quality2 vale2)…) advises compiler that each quality must be given attention according to the specified corresponding value.
(declaration name1, name2,…) advises the compiler that each namej is a valid but non-standard declaration name. The is kind of declaration may be used only as a proclamation. Ex: (proclaim ‘(declaration author                               target-language                               target-machine))    (proclaim ‘(target-language ada))    (proclaim ‘(target-machine IBM-650)) (defun strangep(x)   (declare (author “Harry Tweeker”))  (member  x’(strange weird odd peculiar)))
Type declarations for forms The special form is defined to declare the type of value held by a bound variable. (the type form)the type of value means the type of value of is declared to be of type type. the value-type formthe form is evaluated and whatever it produces is returned by the form, it is an error if what is returned by the form does not confirm to the data-type specified by value-type.
Examples: (the string (copy-seq x)) the result will be a string. (the integer (+ x 3)) the result of + will be an integer. (+ (the integer x) 3)the value of x will be an integer.
Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net

More Related Content

What's hot

CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
Ideal Eyes Business College
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
Saad Sheikh
 
Storage Classes and Functions
Storage Classes and FunctionsStorage Classes and Functions
Storage Classes and Functions
Jake Bond
 
Storage class in c
Storage class in cStorage class in c
Storage class in c
kash95
 
Storage classes in C
Storage classes in C Storage classes in C
Storage classes in C
Self employed
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
Wingston
 
Lecture 13 - Storage Classes
Lecture 13 - Storage ClassesLecture 13 - Storage Classes
Lecture 13 - Storage Classes
Md. Imran Hossain Showrov
 
Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78
Yogesh Mehra
 
Pl sql programme
Pl sql programmePl sql programme
Pl sql programme
Dhilip Prakash
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
Zohaib Ahmed
 
Storage classes in C
Storage classes in CStorage classes in C
Storage classes in C
Nitesh Bichwani
 
Storage Class in C Progrmming
Storage Class in C Progrmming Storage Class in C Progrmming
Storage Class in C Progrmming
Kamal Acharya
 
Lecture04(control structure part i)
Lecture04(control structure part i)Lecture04(control structure part i)
Lecture04(control structure part i)
Dhaka University of Engineering & Technology(DUET)
 
First c program
First c programFirst c program
First c program
NageswaraRao Gogisetti
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
11 lec 11 storage class
11 lec 11 storage class11 lec 11 storage class
11 lec 11 storage class
kapil078
 
C if else
C if elseC if else
C if else
Ritwik Das
 

What's hot (17)

CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
Storage Classes and Functions
Storage Classes and FunctionsStorage Classes and Functions
Storage Classes and Functions
 
Storage class in c
Storage class in cStorage class in c
Storage class in c
 
Storage classes in C
Storage classes in C Storage classes in C
Storage classes in C
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
Lecture 13 - Storage Classes
Lecture 13 - Storage ClassesLecture 13 - Storage Classes
Lecture 13 - Storage Classes
 
Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78Ooabapnoteswithprogram good 78
Ooabapnoteswithprogram good 78
 
Pl sql programme
Pl sql programmePl sql programme
Pl sql programme
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
 
Storage classes in C
Storage classes in CStorage classes in C
Storage classes in C
 
Storage Class in C Progrmming
Storage Class in C Progrmming Storage Class in C Progrmming
Storage Class in C Progrmming
 
Lecture04(control structure part i)
Lecture04(control structure part i)Lecture04(control structure part i)
Lecture04(control structure part i)
 
First c program
First c programFirst c program
First c program
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
11 lec 11 storage class
11 lec 11 storage class11 lec 11 storage class
11 lec 11 storage class
 
C if else
C if elseC if else
C if else
 

Viewers also liked

Excel Datamining Addin Intermediate
Excel Datamining Addin IntermediateExcel Datamining Addin Intermediate
Excel Datamining Addin Intermediate
DataminingTools Inc
 
Apresentação Red Advisers
Apresentação Red AdvisersApresentação Red Advisers
Apresentação Red Advisers
mezkita
 
Festivals Refuerzo
Festivals RefuerzoFestivals Refuerzo
Festivals Refuerzo
guest9536ef5
 
Art, Culture, and Technology
Art, Culture, and TechnologyArt, Culture, and Technology
Art, Culture, and Technology
TVWS, LLC
 
2008 IEDM presentation
2008 IEDM presentation2008 IEDM presentation
2008 IEDM presentation
slrommel
 
Research Presentation
Research PresentationResearch Presentation
Research Presentation
guest136b28e
 
Quick Look At Classification
Quick Look At ClassificationQuick Look At Classification
Quick Look At Classification
DataminingTools Inc
 
Test
TestTest
Retrieving Data From A Database
Retrieving Data From A DatabaseRetrieving Data From A Database
Retrieving Data From A Database
DataminingTools Inc
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
DataminingTools Inc
 
Mysql:Operators
Mysql:OperatorsMysql:Operators
Mysql:Operators
DataminingTools Inc
 
Pentaho: Reporting Solution Development
Pentaho: Reporting Solution DevelopmentPentaho: Reporting Solution Development
Pentaho: Reporting Solution Development
DataminingTools Inc
 
Eugene SRTS Program
Eugene SRTS ProgramEugene SRTS Program
Eugene SRTS Program
Eugene SRTS
 
Data Mining The Sky
Data Mining The SkyData Mining The Sky
Data Mining The Sky
DataminingTools Inc
 
HistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN IiHistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN Iilara
 
Data Applied: Similarity
Data Applied: SimilarityData Applied: Similarity
Data Applied: Similarity
DataminingTools Inc
 
Data Applied:Outliers
Data Applied:OutliersData Applied:Outliers
Data Applied:Outliers
DataminingTools Inc
 
Matlab: Discrete Linear Systems
Matlab: Discrete Linear SystemsMatlab: Discrete Linear Systems
Matlab: Discrete Linear Systems
DataminingTools Inc
 

Viewers also liked (20)

Norihicodanch
NorihicodanchNorihicodanch
Norihicodanch
 
Excel Datamining Addin Intermediate
Excel Datamining Addin IntermediateExcel Datamining Addin Intermediate
Excel Datamining Addin Intermediate
 
Apresentação Red Advisers
Apresentação Red AdvisersApresentação Red Advisers
Apresentação Red Advisers
 
Festivals Refuerzo
Festivals RefuerzoFestivals Refuerzo
Festivals Refuerzo
 
Art, Culture, and Technology
Art, Culture, and TechnologyArt, Culture, and Technology
Art, Culture, and Technology
 
2008 IEDM presentation
2008 IEDM presentation2008 IEDM presentation
2008 IEDM presentation
 
Research Presentation
Research PresentationResearch Presentation
Research Presentation
 
Quick Look At Classification
Quick Look At ClassificationQuick Look At Classification
Quick Look At Classification
 
Test
TestTest
Test
 
Retrieving Data From A Database
Retrieving Data From A DatabaseRetrieving Data From A Database
Retrieving Data From A Database
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Mysql:Operators
Mysql:OperatorsMysql:Operators
Mysql:Operators
 
Pentaho: Reporting Solution Development
Pentaho: Reporting Solution DevelopmentPentaho: Reporting Solution Development
Pentaho: Reporting Solution Development
 
Txomin Hartz Txikia
Txomin Hartz TxikiaTxomin Hartz Txikia
Txomin Hartz Txikia
 
Eugene SRTS Program
Eugene SRTS ProgramEugene SRTS Program
Eugene SRTS Program
 
Data Mining The Sky
Data Mining The SkyData Mining The Sky
Data Mining The Sky
 
HistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN IiHistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN Ii
 
Data Applied: Similarity
Data Applied: SimilarityData Applied: Similarity
Data Applied: Similarity
 
Data Applied:Outliers
Data Applied:OutliersData Applied:Outliers
Data Applied:Outliers
 
Matlab: Discrete Linear Systems
Matlab: Discrete Linear SystemsMatlab: Discrete Linear Systems
Matlab: Discrete Linear Systems
 

Similar to LISP: Declarations In Lisp

X++ 1.pptx
X++ 1.pptxX++ 1.pptx
X++ 1.pptx
Vijay Shukla
 
LISP: Program structure in lisp
LISP: Program structure in lispLISP: Program structure in lisp
LISP: Program structure in lisp
LISP Content
 
LISP:Program structure in lisp
LISP:Program structure in lispLISP:Program structure in lisp
LISP:Program structure in lisp
DataminingTools Inc
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
sharvivek
 
C functions list
C functions listC functions list
Data structure scope of variables
Data structure scope of variablesData structure scope of variables
Data structure scope of variables
Saurav Kumar
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
valarpink
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT Academy
The IOT Academy
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
jatin batra
 
All About ... Functions
All About ... FunctionsAll About ... Functions
All About ... Functions
Michal Bigos
 
C++ quik notes
C++ quik notesC++ quik notes
C++ quik notes
argusacademy
 
C language presentation
C language presentationC language presentation
C language presentation
bainspreet
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12
Dev Chauhan
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
InfinityWorld3
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
Rhishav Poudyal
 
Functions in c
Functions in cFunctions in c
Functions in c
SunithaVesalpu
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
SaqlainYaqub1
 
What is storage class
What is storage classWhat is storage class
What is storage class
Isha Aggarwal
 
solidity programming.pptx
solidity programming.pptxsolidity programming.pptx
solidity programming.pptx
RohiniBagul4
 

Similar to LISP: Declarations In Lisp (20)

X++ 1.pptx
X++ 1.pptxX++ 1.pptx
X++ 1.pptx
 
LISP: Program structure in lisp
LISP: Program structure in lispLISP: Program structure in lisp
LISP: Program structure in lisp
 
LISP:Program structure in lisp
LISP:Program structure in lispLISP:Program structure in lisp
LISP:Program structure in lisp
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
 
C functions list
C functions listC functions list
C functions list
 
Data structure scope of variables
Data structure scope of variablesData structure scope of variables
Data structure scope of variables
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT Academy
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
 
All About ... Functions
All About ... FunctionsAll About ... Functions
All About ... Functions
 
C++ quik notes
C++ quik notesC++ quik notes
C++ quik notes
 
C language presentation
C language presentationC language presentation
C language presentation
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
 
What is storage class
What is storage classWhat is storage class
What is storage class
 
solidity programming.pptx
solidity programming.pptxsolidity programming.pptx
solidity programming.pptx
 

More from DataminingTools Inc

Terminology Machine Learning
Terminology Machine LearningTerminology Machine Learning
Terminology Machine Learning
DataminingTools Inc
 
Techniques Machine Learning
Techniques Machine LearningTechniques Machine Learning
Techniques Machine Learning
DataminingTools Inc
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning Introduction
DataminingTools Inc
 
Areas of machine leanring
Areas of machine leanringAreas of machine leanring
Areas of machine leanring
DataminingTools Inc
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
DataminingTools Inc
 
AI: Logic in AI 2
AI: Logic in AI 2AI: Logic in AI 2
AI: Logic in AI 2
DataminingTools Inc
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
DataminingTools Inc
 
AI: Learning in AI 2
AI: Learning in AI 2AI: Learning in AI 2
AI: Learning in AI 2
DataminingTools Inc
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
DataminingTools Inc
 
AI: Introduction to artificial intelligence
AI: Introduction to artificial intelligenceAI: Introduction to artificial intelligence
AI: Introduction to artificial intelligence
DataminingTools Inc
 
AI: Belief Networks
AI: Belief NetworksAI: Belief Networks
AI: Belief Networks
DataminingTools Inc
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
DataminingTools Inc
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc
 
Data Mining: Text and web mining
Data Mining: Text and web miningData Mining: Text and web mining
Data Mining: Text and web mining
DataminingTools Inc
 
Data Mining: Outlier analysis
Data Mining: Outlier analysisData Mining: Outlier analysis
Data Mining: Outlier analysis
DataminingTools Inc
 
Data Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence dataData Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence data
DataminingTools Inc
 
Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlations
DataminingTools Inc
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysis
DataminingTools Inc
 
Data warehouse and olap technology
Data warehouse and olap technologyData warehouse and olap technology
Data warehouse and olap technology
DataminingTools Inc
 
Data Mining: Data processing
Data Mining: Data processingData Mining: Data processing
Data Mining: Data processing
DataminingTools Inc
 

More from DataminingTools Inc (20)

Terminology Machine Learning
Terminology Machine LearningTerminology Machine Learning
Terminology Machine Learning
 
Techniques Machine Learning
Techniques Machine LearningTechniques Machine Learning
Techniques Machine Learning
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning Introduction
 
Areas of machine leanring
Areas of machine leanringAreas of machine leanring
Areas of machine leanring
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
 
AI: Logic in AI 2
AI: Logic in AI 2AI: Logic in AI 2
AI: Logic in AI 2
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
AI: Learning in AI 2
AI: Learning in AI 2AI: Learning in AI 2
AI: Learning in AI 2
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
 
AI: Introduction to artificial intelligence
AI: Introduction to artificial intelligenceAI: Introduction to artificial intelligence
AI: Introduction to artificial intelligence
 
AI: Belief Networks
AI: Belief NetworksAI: Belief Networks
AI: Belief Networks
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Data Mining: Text and web mining
Data Mining: Text and web miningData Mining: Text and web mining
Data Mining: Text and web mining
 
Data Mining: Outlier analysis
Data Mining: Outlier analysisData Mining: Outlier analysis
Data Mining: Outlier analysis
 
Data Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence dataData Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence data
 
Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlations
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysis
 
Data warehouse and olap technology
Data warehouse and olap technologyData warehouse and olap technology
Data warehouse and olap technology
 
Data Mining: Data processing
Data Mining: Data processingData Mining: Data processing
Data Mining: Data processing
 

Recently uploaded

Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
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
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
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
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 

Recently uploaded (20)

Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
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 -...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
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
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 

LISP: Declarations In Lisp

  • 2. Declarations Declarations allow the user to specify extra information about the program to Lisp system. Declarations are truly optional but special declarations do effect the interpretation of the variable bindings and references and so must be specified wherever necessary. Declarations are one of the good ways to add documentation to the program.
  • 3. overview Declaration syntax Declaration specifiers Type declaration for forms
  • 4. Declaration syntax declare construct is used to embed declarations within the executable code. A declare form is known as the declaration. A declaration may occur only at the beginning of the bodies of the certain special forms. declare {decl-spec}*
  • 5. Declarations may occur in the lambda expressions and in the forms listed below:
  • 6. Variable bindings appear only to the bindings made by the form at the head of whose body they appear. (defun foo (x) (declare (type float x)).. (let (( x’a)) …) ….) The type declaration applies only to the outer binding of the x and not to the binding made in the let. The scope of the declaration always includes the body forms, as well as any “stepper” or “result” forms, of the special forms or lambda-expressions. If the declaration applies to a name binding, then the scope of declaration also includes the scope of the name binding.
  • 7. locally {declaration}* {form}* This macro is used to make local pervasive declarations where desired. This construct does not bind any variables. Special declaration may be used with lacally to pervasively affect references to, rather than bindings of, variables. The function proclaim takes a decl-spec as its argument and puts it into effect globally.
  • 8. proclaim decl-spec The proclaim takes decl-spec as the argument and puts it into effect globally. Ex: (proclaim ‘(type float tolerance)) specifies that the dynamic value of the tolerance should always be a floating-point number. A proclaim takes special decl-spec as applying to all bindings as well as to all references of the mentioned variables. This macro is syntactically like declare and semantically like proclaim. It is an executable form and may be used anywhere proclaim may be called. declaim {decl-spec}*
  • 9. Declaration specifiers List of valid declaration specifiers for use in declare. (special var1 var2….) specifies that all of the variables named are to be considered special. (type var1, var2,…) affects only variable bindings and specifies that the variables mentioned will take on values only of the specified type.
  • 10. (ftype type function-name-1, function-name-2,…) specifies that the named functions will be of the function type type. Ex: (declare (ftype(function (integer list) t) nth) (ftype (function (number) float) sin cos)) To extend ftype declaration specifiers to accept any function-name, one may write (declaim (ftype (function (list) t) (setf cadr)))
  • 11. (inline function1, function2,…)specifies that it is desirable for the compiler to open code calls to the specified functions. The compiler is free to ignore this declaration. (notinline function1, function2,…)specifies that it is undesirable for the compiler to compile the specified functions inline. This declaration is pervasive and the compiler is not free to ignore this declaration. (ignore var1,var2,….) affects only variable bindings and specifies that the bindings of the specified variables are never used. (optimize (quality1 value1) (quality2 vale2)…) advises compiler that each quality must be given attention according to the specified corresponding value.
  • 12. (declaration name1, name2,…) advises the compiler that each namej is a valid but non-standard declaration name. The is kind of declaration may be used only as a proclamation. Ex: (proclaim ‘(declaration author target-language target-machine))  (proclaim ‘(target-language ada)) (proclaim ‘(target-machine IBM-650)) (defun strangep(x) (declare (author “Harry Tweeker”)) (member x’(strange weird odd peculiar)))
  • 13. Type declarations for forms The special form is defined to declare the type of value held by a bound variable. (the type form)the type of value means the type of value of is declared to be of type type. the value-type formthe form is evaluated and whatever it produces is returned by the form, it is an error if what is returned by the form does not confirm to the data-type specified by value-type.
  • 14. Examples: (the string (copy-seq x)) the result will be a string. (the integer (+ x 3)) the result of + will be an integer. (+ (the integer x) 3)the value of x will be an integer.
  • 15. Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net