SlideShare a Scribd company logo
Symbols and Packages in Lisp
A lisp symbol is a data object that has three user-visible components: The property list is the list that effectively provides each symbol with many modifiable named components. The print name must be the  string, which is the sequence of characters used to identify the symbol. The package cell must refer to package object. A package is a data structure used to locate a symbol once given the symbols name. A symbol is uniquely identified by its name only when considered relative to a package.
overview The property List The Print name Creating symbols Packages Translating strings to Symbols Export and import symbols Name conflicts Built-in packages
The property list A property list contains two or more entries, with each entry associated with the key called the indicator. A property list is very much similar to an association list in its purpose, but the difference is that a property list is an object with unique identity. A property list is implemented as a memory cell containing a list with even number(possibly zero) of elements.  Each pair of elements in the list constitutes an entry: the first item is the indicator, the second item is the value. When the symbol is created its property list is initially empty, properties are created by using get within a set form.
get symbol indicator1 &optional default Get searches the property list of the symbol for an indicator eq to indicator1. if one  is found, the corresponding value is returned, else default is returned. Suppose the property list of foo is ( bar t baz 3 hunoz “huh?”) Then ex: (get ‘foo ‘baz)3                      (get ‘foo ‘hunoz)”Huh?”                      (get ‘foo ‘Zoo) nil
remprop symbol indicator1 This removes the symbol from the property with an indicator eq to indicator1. Suppose if property foo was (color blue height 6.3) After using (remprop ‘foo ‘height) the property becomes (color blue) Returns the list that contains the property pairs of the symbol, the contents of the property lists are extracted and returned. symbol-plist symbol
getf place indicator1 &optional default getf searches for the property list stored in place for an indicator eq to indicator1, if found returns the corresponding value, else returns the default or nil. remf removes from the property list stored in the place the property with an indicator eq to indicator1 . The property indicator and the corresponding value are removed by destructively splicing the property list. remf place indicator1
get-properties place indicator-list get-properties searches the property list stored in place for any of the indicators in the indicator-list untill it finds the first property in the property list. Get-properties returns three values: ,[object Object]
The third is the tail of the property whose tail is the indicator.,[object Object]
Creating Symbols Symbols are used in two different ways: An interned symbol is one that is indexed by its print name in its catalog called a package. An uninterned symbol is one that is used simply as a data object with no special cataloguing. An uninterned symbol is printed with #: followed by its print name. make-symbol print-name  creates a new uninterned symbol whose print name is the string print-name.
copy-symbol sym &optional copy-props returns a new uninterented symbol with the same name as of the sym. If copy-props is non-nil, then the initial value and function definition of the new symbol will be the same as those of the sym, and the property list of the new symbol will be a copy of sym’s. gensym &optional  x gensym invents a print name and creates a new symbol with that print name. it returns new uninterented symbol. The invented new print name consists of a prefix( which defaults to G) , followed by decimal representation of a number. The number is increased by 1 every time gensym is called.
gentamp &optional prefix package gentemp like gensym, creates and returns new symbol. The only difference is gentemp interns the symbol in the package. Symbol-package sym  returns the contents of the package cell of that symbol. This will be a package object or nil. Keywordp object returns true if the argument is a symbol and that symbol is a keyword.
Packages A package is a data structure that is used for mapping the print names (strings) to symbols. The string-to symbol mappings available in the given package are divided into two classes:   ,[object Object]
 internal( normally hidden from other packages).A symbol is said to be interned in a package if it is accessible in that package and also is owned.
Consistency rules In dealing with package system, it is useful to follow the consistency rules: ,[object Object]
Print-read consistency: An interned symbol always as a sequence of characters that, when read back in, yields the same (eq) symbol.
Print-print consistancy:if two interned symbols are not eq, then their printed representations will be different sequence of characters.,[object Object]
Translating strings to symbols Whatever packet object is currently the value of *package* is referred to as current-package. When the lisp reader has obtained a string of characters thought to name a symbol, that name is looked up in the current package. If the name is found, the corresponding  symbol is returned, if the name is not found, a new  symbol is created for it and is placed in the current package as an internal symbol. External symbol in some other package is referred  through the qualified name, consisting of the package name, then a colon, then the name of the symbol. Ex:  editor: buffer refers to external symbol buffer accessible in the package named editor.
The following four symbol qualifying syntaxes are used: foo: bar look up bar among the external symbols of the package named foo, printed when the symbol bar is external in its home package foo and is not accessible in the current package. foo::bar interns bar as if foo is the current page,  printed when symbol bar is internal in its home page foo, and is not accessible in the current page. :bar interns bar as the external symbol in the keyword package and makes it evaluate to itself. Printed if the home page of the symbol bar is keyword. #:bar creates a new uninterned symbol named BAR. Printed when the symbol BAR is uninterented(has no home package )
Exporting and Importing Symbols Symbols from one package may be exported to imported from other packages by the use of functions export and import respectively. (import ‘editor:buffer) takes the external symbol named buffer in the editor package and adds it to the current package as an internal symbol. A symbol is said to be shadowed by another symbol in some package if the first symbol would be accessible by inheritance if not for the presence of the second symbol.
To import a symbol without the possibility of getting the error because of shadowing use the function shadowing-import. Use package causes a package to inherit all of the external symbols from some other package. Unlike import, use-package does not cause any of the new symbols to be present in the current package, but makes them accessible by inheritance.
The function export takes the symbol that is accessible in some specified package, and makes it an external symbol of that package. If the symbol is directly present as an internal symbol, the it is imply changed to external status. If the symbol is accessible via use-package, the symbol is first imported to the package and then exported. If the same name is being used more than once name-conflicts may occur, so care has to be taken to avoid any such name conflicts.
Built-in Packages Common lisp built-in packages: Lisp contains the primitives of the common lisp system. Its external symbols include all of the user defined functions such as car, car and *package*. user package is the current package at the time a Common Lisp system starts up.  common-lisp package contains the primitives of the ANSI commomLisp system. common-lisp-user is by default the current package at the time, an ANSI common Lisp system starts up.

More Related Content

What's hot

Python revision tour II
Python revision tour IIPython revision tour II
Python revision tour II
Mr. Vikram Singh Slathia
 
Learn Python The Hard Way Presentation
Learn Python The Hard Way PresentationLearn Python The Hard Way Presentation
Learn Python The Hard Way Presentation
Amira ElSharkawy
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
Mohd Sajjad
 
Introduction to Python Language and Data Types
Introduction to Python Language and Data TypesIntroduction to Python Language and Data Types
Introduction to Python Language and Data Types
Ravi Shankar
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginners
Abishek Purushothaman
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
sana mateen
 
Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
srinivasanr281952
 
Python second ppt
Python second pptPython second ppt
Python second ppt
RaginiJain21
 
Python language data types
Python language data typesPython language data types
Python language data types
Hoang Nguyen
 
Introduction To Programming with Python-3
Introduction To Programming with Python-3Introduction To Programming with Python-3
Introduction To Programming with Python-3
Syed Farjad Zia Zaidi
 
Python Session - 4
Python Session - 4Python Session - 4
Python Session - 4
AnirudhaGaikwad4
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
Raghavan Mohan
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Languagezone
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
kiran acharya
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
amiable_indian
 
Operator precedance parsing
Operator precedance parsingOperator precedance parsing
Operator precedance parsing
sanchi29
 
Python-The programming Language
Python-The programming LanguagePython-The programming Language
Python-The programming Language
Rohan Gupta
 

What's hot (19)

Python revision tour II
Python revision tour IIPython revision tour II
Python revision tour II
 
Learn Python The Hard Way Presentation
Learn Python The Hard Way PresentationLearn Python The Hard Way Presentation
Learn Python The Hard Way Presentation
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
 
Introduction to Python Language and Data Types
Introduction to Python Language and Data TypesIntroduction to Python Language and Data Types
Introduction to Python Language and Data Types
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginners
 
Javascript
JavascriptJavascript
Javascript
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
 
Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
 
Python second ppt
Python second pptPython second ppt
Python second ppt
 
Python language data types
Python language data typesPython language data types
Python language data types
 
Introduction To Programming with Python-3
Introduction To Programming with Python-3Introduction To Programming with Python-3
Introduction To Programming with Python-3
 
Perl_Part1
Perl_Part1Perl_Part1
Perl_Part1
 
Python Session - 4
Python Session - 4Python Session - 4
Python Session - 4
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Language
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Operator precedance parsing
Operator precedance parsingOperator precedance parsing
Operator precedance parsing
 
Python-The programming Language
Python-The programming LanguagePython-The programming Language
Python-The programming Language
 

Viewers also liked

Lazy Association Classification
Lazy Association ClassificationLazy Association Classification
Lazy Association ClassificationJason Yang
 
Festivals Refuerzo
Festivals RefuerzoFestivals Refuerzo
Festivals Refuerzo
guest9536ef5
 
Simulation
SimulationSimulation
SPSS: File Managment
SPSS: File ManagmentSPSS: File Managment
SPSS: File Managment
DataminingTools Inc
 
Probability And Its Axioms
Probability And Its AxiomsProbability And Its Axioms
Probability And Its Axioms
DataminingTools Inc
 
Association Rules
Association RulesAssociation Rules
Association Rules
DataminingTools Inc
 
Vision To Profit V2 Sept 2009
Vision To Profit V2 Sept 2009Vision To Profit V2 Sept 2009
Vision To Profit V2 Sept 2009
Tibbs Pereira
 
Épica Latina Latín II
Épica Latina Latín IIÉpica Latina Latín II
Épica Latina Latín II
lara
 
Direct-services portfolio
Direct-services portfolioDirect-services portfolio
Direct-services portfoliovlastakolaja
 
Ccc
CccCcc
MySql:Basics
MySql:BasicsMySql:Basics
MySql:Basics
DataminingTools Inc
 
DataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business ApplicationsDataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business Applications
Tibbs Pereira
 
LISP:Loops In Lisp
LISP:Loops In LispLISP:Loops In Lisp
LISP:Loops In Lisp
DataminingTools Inc
 
Introduction to Data-Applied
Introduction to Data-AppliedIntroduction to Data-Applied
Introduction to Data-Applied
DataminingTools Inc
 
Art, Culture, and Technology
Art, Culture, and TechnologyArt, Culture, and Technology
Art, Culture, and TechnologyTVWS, LLC
 
WEKA: Output Knowledge Representation
WEKA: Output Knowledge RepresentationWEKA: Output Knowledge Representation
WEKA: Output Knowledge Representation
DataminingTools Inc
 
Communicating simply
Communicating simplyCommunicating simply
Communicating simply
Mustansir Husain
 
Data Applied: Association
Data Applied: AssociationData Applied: Association
Data Applied: Association
DataminingTools Inc
 
Data
DataData
Control Statements in Matlab
Control Statements in  MatlabControl Statements in  Matlab
Control Statements in Matlab
DataminingTools Inc
 

Viewers also liked (20)

Lazy Association Classification
Lazy Association ClassificationLazy Association Classification
Lazy Association Classification
 
Festivals Refuerzo
Festivals RefuerzoFestivals Refuerzo
Festivals Refuerzo
 
Simulation
SimulationSimulation
Simulation
 
SPSS: File Managment
SPSS: File ManagmentSPSS: File Managment
SPSS: File Managment
 
Probability And Its Axioms
Probability And Its AxiomsProbability And Its Axioms
Probability And Its Axioms
 
Association Rules
Association RulesAssociation Rules
Association Rules
 
Vision To Profit V2 Sept 2009
Vision To Profit V2 Sept 2009Vision To Profit V2 Sept 2009
Vision To Profit V2 Sept 2009
 
Épica Latina Latín II
Épica Latina Latín IIÉpica Latina Latín II
Épica Latina Latín II
 
Direct-services portfolio
Direct-services portfolioDirect-services portfolio
Direct-services portfolio
 
Ccc
CccCcc
Ccc
 
MySql:Basics
MySql:BasicsMySql:Basics
MySql:Basics
 
DataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business ApplicationsDataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business Applications
 
LISP:Loops In Lisp
LISP:Loops In LispLISP:Loops In Lisp
LISP:Loops In Lisp
 
Introduction to Data-Applied
Introduction to Data-AppliedIntroduction to Data-Applied
Introduction to Data-Applied
 
Art, Culture, and Technology
Art, Culture, and TechnologyArt, Culture, and Technology
Art, Culture, and Technology
 
WEKA: Output Knowledge Representation
WEKA: Output Knowledge RepresentationWEKA: Output Knowledge Representation
WEKA: Output Knowledge Representation
 
Communicating simply
Communicating simplyCommunicating simply
Communicating simply
 
Data Applied: Association
Data Applied: AssociationData Applied: Association
Data Applied: Association
 
Data
DataData
Data
 
Control Statements in Matlab
Control Statements in  MatlabControl Statements in  Matlab
Control Statements in Matlab
 

Similar to LISP:Symbols and packages in lisp

LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
DataminingTools Inc
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
LISP Content
 
AssignmentModify the Python program by adding the create_dictiona.pdf
AssignmentModify the Python program by adding the create_dictiona.pdfAssignmentModify the Python program by adding the create_dictiona.pdf
AssignmentModify the Python program by adding the create_dictiona.pdf
tsekar2004
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer Science
KrithikaTM
 
Python. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdfPython. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdf
prasenjitghosh1998
 
parser
parserparser
parser
Rajendran
 
Vizwik Coding Manual
Vizwik Coding ManualVizwik Coding Manual
Vizwik Coding Manual
Vizwik
 
AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
prakashvs7
 
Functions2.pdf
Functions2.pdfFunctions2.pdf
Functions2.pdf
prasnt1
 
cbse class 12 Python Functions2 for class 12 .pptx
cbse class 12 Python Functions2 for class 12 .pptxcbse class 12 Python Functions2 for class 12 .pptx
cbse class 12 Python Functions2 for class 12 .pptx
tcsonline1222
 
Python programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsPython programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operations
Megha V
 
1. python
1. python1. python
1. python
PRASHANT OJHA
 
Python cheatsheet for beginners
Python cheatsheet for beginnersPython cheatsheet for beginners
Python cheatsheet for beginners
Lahore Garrison University
 
Beginners python cheat sheet - Basic knowledge
Beginners python cheat sheet - Basic knowledge Beginners python cheat sheet - Basic knowledge
Beginners python cheat sheet - Basic knowledge
O T
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdf
actioncbe1
 
Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4Anton Kasyanov
 
AI Programming language (LISP)
AI Programming language (LISP)AI Programming language (LISP)
AI Programming language (LISP)
SURBHI SAROHA
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .
tarunsharmaug23
 
11 Introduction to lists.pptx
11 Introduction to lists.pptx11 Introduction to lists.pptx
11 Introduction to lists.pptx
ssuser8e50d8
 

Similar to LISP:Symbols and packages in lisp (20)

LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
AssignmentModify the Python program by adding the create_dictiona.pdf
AssignmentModify the Python program by adding the create_dictiona.pdfAssignmentModify the Python program by adding the create_dictiona.pdf
AssignmentModify the Python program by adding the create_dictiona.pdf
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer Science
 
Python. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdfPython. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdf
 
parser
parserparser
parser
 
Vizwik Coding Manual
Vizwik Coding ManualVizwik Coding Manual
Vizwik Coding Manual
 
AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
 
Functions2.pdf
Functions2.pdfFunctions2.pdf
Functions2.pdf
 
cbse class 12 Python Functions2 for class 12 .pptx
cbse class 12 Python Functions2 for class 12 .pptxcbse class 12 Python Functions2 for class 12 .pptx
cbse class 12 Python Functions2 for class 12 .pptx
 
Python programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsPython programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operations
 
Compiler Design QA
Compiler Design QACompiler Design QA
Compiler Design QA
 
1. python
1. python1. python
1. python
 
Python cheatsheet for beginners
Python cheatsheet for beginnersPython cheatsheet for beginners
Python cheatsheet for beginners
 
Beginners python cheat sheet - Basic knowledge
Beginners python cheat sheet - Basic knowledge Beginners python cheat sheet - Basic knowledge
Beginners python cheat sheet - Basic knowledge
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdf
 
Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4
 
AI Programming language (LISP)
AI Programming language (LISP)AI Programming language (LISP)
AI Programming language (LISP)
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .
 
11 Introduction to lists.pptx
11 Introduction to lists.pptx11 Introduction to lists.pptx
11 Introduction to lists.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

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
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
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
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
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
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
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
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
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
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
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
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 

Recently uploaded (20)

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
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
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
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
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
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
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...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
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
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 

LISP:Symbols and packages in lisp

  • 2. A lisp symbol is a data object that has three user-visible components: The property list is the list that effectively provides each symbol with many modifiable named components. The print name must be the string, which is the sequence of characters used to identify the symbol. The package cell must refer to package object. A package is a data structure used to locate a symbol once given the symbols name. A symbol is uniquely identified by its name only when considered relative to a package.
  • 3. overview The property List The Print name Creating symbols Packages Translating strings to Symbols Export and import symbols Name conflicts Built-in packages
  • 4. The property list A property list contains two or more entries, with each entry associated with the key called the indicator. A property list is very much similar to an association list in its purpose, but the difference is that a property list is an object with unique identity. A property list is implemented as a memory cell containing a list with even number(possibly zero) of elements. Each pair of elements in the list constitutes an entry: the first item is the indicator, the second item is the value. When the symbol is created its property list is initially empty, properties are created by using get within a set form.
  • 5. get symbol indicator1 &optional default Get searches the property list of the symbol for an indicator eq to indicator1. if one is found, the corresponding value is returned, else default is returned. Suppose the property list of foo is ( bar t baz 3 hunoz “huh?”) Then ex: (get ‘foo ‘baz)3 (get ‘foo ‘hunoz)”Huh?” (get ‘foo ‘Zoo) nil
  • 6. remprop symbol indicator1 This removes the symbol from the property with an indicator eq to indicator1. Suppose if property foo was (color blue height 6.3) After using (remprop ‘foo ‘height) the property becomes (color blue) Returns the list that contains the property pairs of the symbol, the contents of the property lists are extracted and returned. symbol-plist symbol
  • 7. getf place indicator1 &optional default getf searches for the property list stored in place for an indicator eq to indicator1, if found returns the corresponding value, else returns the default or nil. remf removes from the property list stored in the place the property with an indicator eq to indicator1 . The property indicator and the corresponding value are removed by destructively splicing the property list. remf place indicator1
  • 8.
  • 9.
  • 10. Creating Symbols Symbols are used in two different ways: An interned symbol is one that is indexed by its print name in its catalog called a package. An uninterned symbol is one that is used simply as a data object with no special cataloguing. An uninterned symbol is printed with #: followed by its print name. make-symbol print-name creates a new uninterned symbol whose print name is the string print-name.
  • 11. copy-symbol sym &optional copy-props returns a new uninterented symbol with the same name as of the sym. If copy-props is non-nil, then the initial value and function definition of the new symbol will be the same as those of the sym, and the property list of the new symbol will be a copy of sym’s. gensym &optional x gensym invents a print name and creates a new symbol with that print name. it returns new uninterented symbol. The invented new print name consists of a prefix( which defaults to G) , followed by decimal representation of a number. The number is increased by 1 every time gensym is called.
  • 12. gentamp &optional prefix package gentemp like gensym, creates and returns new symbol. The only difference is gentemp interns the symbol in the package. Symbol-package sym returns the contents of the package cell of that symbol. This will be a package object or nil. Keywordp object returns true if the argument is a symbol and that symbol is a keyword.
  • 13.
  • 14. internal( normally hidden from other packages).A symbol is said to be interned in a package if it is accessible in that package and also is owned.
  • 15.
  • 16. Print-read consistency: An interned symbol always as a sequence of characters that, when read back in, yields the same (eq) symbol.
  • 17.
  • 18. Translating strings to symbols Whatever packet object is currently the value of *package* is referred to as current-package. When the lisp reader has obtained a string of characters thought to name a symbol, that name is looked up in the current package. If the name is found, the corresponding symbol is returned, if the name is not found, a new symbol is created for it and is placed in the current package as an internal symbol. External symbol in some other package is referred through the qualified name, consisting of the package name, then a colon, then the name of the symbol. Ex: editor: buffer refers to external symbol buffer accessible in the package named editor.
  • 19. The following four symbol qualifying syntaxes are used: foo: bar look up bar among the external symbols of the package named foo, printed when the symbol bar is external in its home package foo and is not accessible in the current package. foo::bar interns bar as if foo is the current page, printed when symbol bar is internal in its home page foo, and is not accessible in the current page. :bar interns bar as the external symbol in the keyword package and makes it evaluate to itself. Printed if the home page of the symbol bar is keyword. #:bar creates a new uninterned symbol named BAR. Printed when the symbol BAR is uninterented(has no home package )
  • 20. Exporting and Importing Symbols Symbols from one package may be exported to imported from other packages by the use of functions export and import respectively. (import ‘editor:buffer) takes the external symbol named buffer in the editor package and adds it to the current package as an internal symbol. A symbol is said to be shadowed by another symbol in some package if the first symbol would be accessible by inheritance if not for the presence of the second symbol.
  • 21. To import a symbol without the possibility of getting the error because of shadowing use the function shadowing-import. Use package causes a package to inherit all of the external symbols from some other package. Unlike import, use-package does not cause any of the new symbols to be present in the current package, but makes them accessible by inheritance.
  • 22. The function export takes the symbol that is accessible in some specified package, and makes it an external symbol of that package. If the symbol is directly present as an internal symbol, the it is imply changed to external status. If the symbol is accessible via use-package, the symbol is first imported to the package and then exported. If the same name is being used more than once name-conflicts may occur, so care has to be taken to avoid any such name conflicts.
  • 23. Built-in Packages Common lisp built-in packages: Lisp contains the primitives of the common lisp system. Its external symbols include all of the user defined functions such as car, car and *package*. user package is the current package at the time a Common Lisp system starts up. common-lisp package contains the primitives of the ANSI commomLisp system. common-lisp-user is by default the current package at the time, an ANSI common Lisp system starts up.
  • 24. Built-in packages Keyword package contains all the keywords used by built-in or user-defined Lisp functions. System package name is reserved to the implementation. This is used to contain names of implementation-dependent system-interface functions. This package uses lisp and has the nickname sys.
  • 25. 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