SlideShare une entreprise Scribd logo
1  sur  19
Type specifiers in Lisp
Overview ,[object Object]
 Predicating Type specifies
  Type specifies:
That Combine
That specialize
That abbreviate
 Defining new type specifies
 Type conversion function
 Type upgrading,[object Object]
Type specifier symbols Standard type specifier symbols are: array                           fixnum                   package                              simple-string atom                           float                       pathname                          simple-vector bignum                       function                random-state                    single-float Bit                               hash-table            ratio                                      standard-char Bit -vector                  integer                   rational                                stream character                    keyword                readtable                             string [common ]               list sequence        string                                  char Compiled-function    long-float             short-float                             symbol complex                      nil                           signed-byte                           t cons                             null                         simple-array                         unsigned-byte Double-float               number                  simple-bit-vector                 vector
Type specifier Lists ,[object Object]
 The unspecified subsidiary items are indicated using the *Ex: To completely specify the vector type, one must mention the type of the elements and length of the vector ( vector float 100) ,[object Object],(vector float *) ,[object Object],( vector * 100)
Predicating type specifies ,[object Object]
The call (typep  x  ‘ (satisfies p)) assigns p to x and returns t if true and returns nil if the result is false.Ex: (deftype string-char()               ' (and character (satisfies string-char-p)))  STRING-CHAR
Type specifies that combine ,[object Object],(member object1 object2 ….) ,[object Object],(not type) denotes the set of all objects that are not in the specified type. (and type1 type2 ….) denotes the intersection of the specified objects. (or  type1 type2 ….) denotes the union of the specified types.
Type specifies that specialize ,[object Object]
 Types can be of two different purposes:
 declaration(  declaring to make array that elements will always be of type short-float permits optimization.)

Contenu connexe

Tendances

Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular Expression
Masudul Haque
 

Tendances (20)

Finite Systems Handling Language (YAFOLL message 1)
Finite Systems Handling Language (YAFOLL message 1)Finite Systems Handling Language (YAFOLL message 1)
Finite Systems Handling Language (YAFOLL message 1)
 
Ch6
Ch6Ch6
Ch6
 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type Checking
 
Javascript
JavascriptJavascript
Javascript
 
M C6java3
M C6java3M C6java3
M C6java3
 
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular Expression
 
Hot С++: Universal References And Perfect Forwarding
Hot С++: Universal References And Perfect ForwardingHot С++: Universal References And Perfect Forwarding
Hot С++: Universal References And Perfect Forwarding
 
LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
 
Regular Expressions in Java
Regular Expressions in JavaRegular Expressions in Java
Regular Expressions in Java
 
4 Expressions and Operators
4  Expressions and Operators4  Expressions and Operators
4 Expressions and Operators
 
Class XII Computer Science Study Material
Class XII Computer Science Study MaterialClass XII Computer Science Study Material
Class XII Computer Science Study Material
 
Programming in scala - 1
Programming in scala - 1Programming in scala - 1
Programming in scala - 1
 
Data Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# ProgrammingData Types, Variables, and Constants in C# Programming
Data Types, Variables, and Constants in C# Programming
 
Summary of effective modern c++ item1 2
Summary of effective modern c++ item1 2Summary of effective modern c++ item1 2
Summary of effective modern c++ item1 2
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
Basic
BasicBasic
Basic
 
RegexCat
RegexCatRegexCat
RegexCat
 
Hot C++: Rvalue References And Move Semantics
Hot C++: Rvalue References And Move SemanticsHot C++: Rvalue References And Move Semantics
Hot C++: Rvalue References And Move Semantics
 
Comparable/ Comparator
Comparable/ ComparatorComparable/ Comparator
Comparable/ Comparator
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 

Similaire à LISP: Type specifiers in lisp

Real World Haskell: Lecture 3
Real World Haskell: Lecture 3Real World Haskell: Lecture 3
Real World Haskell: Lecture 3
Bryan O'Sullivan
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
phanleson
 
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDY
Rajeshkumar Reddy
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
bolovv
 

Similaire à LISP: Type specifiers in lisp (20)

LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
 
String, string builder, string buffer
String, string builder, string bufferString, string builder, string buffer
String, string builder, string buffer
 
Real World Haskell: Lecture 3
Real World Haskell: Lecture 3Real World Haskell: Lecture 3
Real World Haskell: Lecture 3
 
stringstringbuilderstringbuffer-190830060142.pptx
stringstringbuilderstringbuffer-190830060142.pptxstringstringbuilderstringbuffer-190830060142.pptx
stringstringbuilderstringbuffer-190830060142.pptx
 
C# String
C# StringC# String
C# String
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
Java Generics Introduction - Syntax Advantages and Pitfalls
Java Generics Introduction - Syntax Advantages and PitfallsJava Generics Introduction - Syntax Advantages and Pitfalls
Java Generics Introduction - Syntax Advantages and Pitfalls
 
IMP PPT- Python programming fundamentals.pptx
IMP PPT- Python programming fundamentals.pptxIMP PPT- Python programming fundamentals.pptx
IMP PPT- Python programming fundamentals.pptx
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
 
Chapter - 2.pptx
Chapter - 2.pptxChapter - 2.pptx
Chapter - 2.pptx
 
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDY
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
 
Data types
Data typesData types
Data types
 
Concepts
ConceptsConcepts
Concepts
 
Introduction to array and string
Introduction to array and stringIntroduction to array and string
Introduction to array and string
 
Java Basics
Java BasicsJava Basics
Java Basics
 
All About ... Functions
All About ... FunctionsAll About ... Functions
All About ... Functions
 
ASNP
ASNPASNP
ASNP
 
Etiquetas JavaServer Faces
Etiquetas JavaServer FacesEtiquetas JavaServer Faces
Etiquetas JavaServer Faces
 

Plus de LISP Content (11)

LISP: Control Structures In Lisp
LISP: Control Structures In LispLISP: Control Structures In Lisp
LISP: Control Structures In Lisp
 
LISP:Declarations In Lisp
LISP:Declarations In LispLISP:Declarations In Lisp
LISP:Declarations In Lisp
 
LISP: Errors In Lisp
LISP: Errors In LispLISP: Errors In Lisp
LISP: Errors In Lisp
 
LISP: Object Sytstem Lisp
LISP: Object Sytstem LispLISP: Object Sytstem Lisp
LISP: Object Sytstem Lisp
 
LISP: Loops In Lisp
LISP: Loops In LispLISP: Loops In Lisp
LISP: Loops In Lisp
 
LISP: Symbols and packages in lisp
LISP: Symbols and packages in lispLISP: Symbols and packages in lisp
LISP: Symbols and packages in lisp
 
LISP: Scope and extent in lisp
LISP: Scope and extent in lispLISP: Scope and extent in lisp
LISP: Scope and extent in lisp
 
LISP: Program structure in lisp
LISP: Program structure in lispLISP: Program structure in lisp
LISP: Program structure in lisp
 
LISP: Predicates in lisp
LISP: Predicates in lispLISP: Predicates in lisp
LISP: Predicates in lisp
 
LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

LISP: Type specifiers in lisp

  • 2.
  • 4. Type specifies:
  • 8. Defining new type specifies
  • 10.
  • 11. Type specifier symbols Standard type specifier symbols are: array fixnum package simple-string atom float pathname simple-vector bignum function random-state single-float Bit hash-table ratio standard-char Bit -vector integer rational stream character keyword readtable string [common ] list sequence string char Compiled-function long-float short-float symbol complex nil signed-byte t cons null simple-array unsigned-byte Double-float number simple-bit-vector vector
  • 12.
  • 13.
  • 14.
  • 15. The call (typep x ‘ (satisfies p)) assigns p to x and returns t if true and returns nil if the result is false.Ex: (deftype string-char() ' (and character (satisfies string-char-p)))  STRING-CHAR
  • 16.
  • 17.
  • 18. Types can be of two different purposes:
  • 19. declaration( declaring to make array that elements will always be of type short-float permits optimization.)
  • 20.
  • 21. (vector element-type size)  set of one dimensional arrays whose elements are of type element type and whose length is eq ti size. Ex: (vector *5) vector of length 5 ( vector double-float) floating-point numbers. (simple-vector size)  specifies that the elements are of simple general vectors. (complex type1)  every element of this type is a complex number whose real part and imaginary part are each of type type1)
  • 22.
  • 23.
  • 24. (unsigned-byte s) set of non-negative integers that can be represented in a byte of s bits. (string size) set of strings of indicated size. (base-string size) set of base strings of indicated size (bit-vector size)set of bit-vectors of indicated size.
  • 25.
  • 26. the deftype special form can be used to define new type-specifier abbreviations.Syntax: deftype name lambda-list [{declaration}* | doc-string ] {form}* [macro] Name is the symbol that identifies the type specifier Form constitutes the body of expander function Ex: (deftype mod (n) ‘ (integer 0 ( ,n)))
  • 27.
  • 28.