SlideShare a Scribd company logo
Program structure in Lisp
overview Forms Variables Macros Function calls Named functions Lambda expressions Top-level forms Declaring global variables and named constants Control of time and evaluation
forms Forms are the standard units of iteration in CL implementation. A form is simply a data object meant to be evaluated as a program to produce one or more values. Meaning full forms may be further divided into: ,[object Object]
Symbols(variables)
ListsLists can further be divided as: special forms, macro calls and function calls. All characters, numbers, string, and bit-vectors are all self-evaluating forms. When such an object is evaluated, that object is returned as the value of the form.
Variables Symbols are used as the names for the variables in CL programs. When a symbol is evaluated as the form, the value of the variable it names is produced. Ex: (setq w 8)produces 8 Types of variables: ,[object Object]
Special (dynamic),[object Object]
It is recommended that the program-analyzing program process a form that is a list whose car is a symbol as follows: ,[object Object]
If the macro-function is true of the symbol, apply either macro-expand or macroexpand-1, as appropriate to the entire form and then start over.
Otherwise, assume it as a function call.,[object Object]
Function calls While the list is being evaluated as a form, if the first element is not a symbol that names a special form or a macro, the it is considered as a function call. The first element of the list is taken as the name of the function. All the remaining elements of the list are evaluated and one value is obtained from each form, and these values become the arguments to the function. Whatever values the function returns becomes the values of the function-call forms.
Function calls continued.. Ex: (+ 3 (* 1 2)) here, + is not a special form or macro. So 3 and (* 1 2) are considered as arguments of the function call, again 1 2 are taken as arguments of the function call (* 1 2) and the value 2 is returned. The values 2 and 3 are given as arguments for the addition function to produce the result 5.  Thus, ( + 3 (* 1 2))5
Functions Two ways to indicate the function as the function-call form are: ,[object Object]
 using a lambda-expression whose first element in the list is lambda.Lambda expressions or the symbols when used in programs as the name of the functions, can appear only as the first element of the function-call form, or the second element of the function special form. A global name can be given to a function using the defun construct. A local name is given to the function using the flet or labels construct.
Lambda-expressions A lambda-expression has the following syntax: (lambda lambda-list .body) The first element must be lambda, the second element must be the list, and specifies names for the parameters of the list The body may consists of zero or more number of forms. Each element in the lambda-list is either a parameter specifier or the lambda-list keyword. (lambda-list keywords begin with &) Var or svar must be a symbol( the name of the variable), Each keyword must be a keyword symbol, such as :start
A lambda-list has five parts Specifiers for the required parameters: these are parameter specifiers up to the first lambda-list keyword. Specifiers for the optional parameters: these are the specifiers  following the lambda-list keyword &optional up to the next lambda-list keyword or the end of the list. A specifier for a rest parameter Specifiers for the keyword parameters Specifiers for the aux parameters: If the lambda-list keyword &key is present, all specifiers after it are auxiliary variable specifiers.
Top-level forms The standard way to interact with CL implementation is via a read-eval-print loop. The system reads a form from the same input source, evaluates it and then prints the value to the output sink. Top-level special forms are used: ,[object Object]
Define macros
Make declarations
Define global values for special variablesIf progn appears at top-level, then all forms within that progn are considered by the compiler to be top-level forms.

More Related Content

What's hot

9 subprograms
9 subprograms9 subprograms
9 subprograms
Munawar Ahmed
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of c
kinish kumar
 
Ch9 Functions
Ch9 FunctionsCh9 Functions
Ch9 Functions
SzeChingChen
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
Rutvik Pensionwar
 
Ch10 Program Organization
Ch10 Program OrganizationCh10 Program Organization
Ch10 Program Organization
SzeChingChen
 
User defined function in c
User defined function in cUser defined function in c
User defined function in c
JeevanandhamSubraman
 
Functions in C
Functions in CFunctions in C
Functions in C
Kamal Acharya
 
09 implementing+subprograms
09 implementing+subprograms09 implementing+subprograms
09 implementing+subprograms
baran19901990
 
Chap 2 structure of c programming dti2143
Chap 2  structure of c programming dti2143Chap 2  structure of c programming dti2143
Chap 2 structure of c programming dti2143alish sha
 
C language for Semester Exams for Engineers
C language for Semester Exams for Engineers C language for Semester Exams for Engineers
C language for Semester Exams for Engineers
Appili Vamsi Krishna
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
TejaswiB4
 
Ch2 C Fundamentals
Ch2 C FundamentalsCh2 C Fundamentals
Ch2 C Fundamentals
SzeChingChen
 
Pptchapter04
Pptchapter04Pptchapter04
Pptchapter04
Richard Styner
 
DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)
RajKumarSingh213
 
9 subprograms
9 subprograms9 subprograms
9 subprogramsjigeno
 
Chapter 13.1.6
Chapter 13.1.6Chapter 13.1.6
Chapter 13.1.6patcha535
 
Ppt chapter07
Ppt chapter07Ppt chapter07
Ppt chapter07
Richard Styner
 
Chapter 3(1)
Chapter 3(1)Chapter 3(1)
Chapter 3(1)
TejaswiB4
 
structure of a c program
structure of a c programstructure of a c program
structure of a c program
sruthi yandapalli
 

What's hot (20)

9 subprograms
9 subprograms9 subprograms
9 subprograms
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of c
 
ANSI C Macros
ANSI C MacrosANSI C Macros
ANSI C Macros
 
Ch9 Functions
Ch9 FunctionsCh9 Functions
Ch9 Functions
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Ch10 Program Organization
Ch10 Program OrganizationCh10 Program Organization
Ch10 Program Organization
 
User defined function in c
User defined function in cUser defined function in c
User defined function in c
 
Functions in C
Functions in CFunctions in C
Functions in C
 
09 implementing+subprograms
09 implementing+subprograms09 implementing+subprograms
09 implementing+subprograms
 
Chap 2 structure of c programming dti2143
Chap 2  structure of c programming dti2143Chap 2  structure of c programming dti2143
Chap 2 structure of c programming dti2143
 
C language for Semester Exams for Engineers
C language for Semester Exams for Engineers C language for Semester Exams for Engineers
C language for Semester Exams for Engineers
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Ch2 C Fundamentals
Ch2 C FundamentalsCh2 C Fundamentals
Ch2 C Fundamentals
 
Pptchapter04
Pptchapter04Pptchapter04
Pptchapter04
 
DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)
 
9 subprograms
9 subprograms9 subprograms
9 subprograms
 
Chapter 13.1.6
Chapter 13.1.6Chapter 13.1.6
Chapter 13.1.6
 
Ppt chapter07
Ppt chapter07Ppt chapter07
Ppt chapter07
 
Chapter 3(1)
Chapter 3(1)Chapter 3(1)
Chapter 3(1)
 
structure of a c program
structure of a c programstructure of a c program
structure of a c program
 

Similar to LISP: Program structure in lisp

LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
DataminingTools Inc
 
LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
LISP Content
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
C language 3
C language 3C language 3
C language 3
Arafat Bin Reza
 
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
 
User defined functions in matlab
User defined functions in  matlabUser defined functions in  matlab
User defined functions in matlab
Infinity Tech Solutions
 
Function overloading
Function overloadingFunction overloading
Function overloading
Selvin Josy Bai Somu
 
Functions
FunctionsFunctions
Functions
Septi Ratnasari
 
04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx
Manas40552
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdf
venud11
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming languageVasavi College of Engg
 
Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»
e-Legion
 
scala.reflect, Eugene Burmako
scala.reflect, Eugene Burmakoscala.reflect, Eugene Burmako
scala.reflect, Eugene Burmako
Vasil Remeniuk
 
Function in C++
Function in C++Function in C++
Function in C++
Prof Ansari
 
FUNCTION CPU
FUNCTION CPUFUNCTION CPU
FUNCTION CPU
Krushal Kakadia
 
Programming style guideline very good
Programming style guideline very goodProgramming style guideline very good
Programming style guideline very good
Dang Hop
 
Opps concept
Opps conceptOpps concept
Opps concept
divyalakshmi77
 
imperative programming language, java, android
imperative programming language, java, androidimperative programming language, java, android
imperative programming language, java, android
i i
 

Similar to LISP: Program structure in lisp (20)

LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
 
LISP: Macros in lisp
LISP: Macros in lispLISP: Macros in lisp
LISP: Macros in lisp
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
C language 3
C language 3C language 3
C language 3
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
 
User defined functions in matlab
User defined functions in  matlabUser defined functions in  matlab
User defined functions in matlab
 
Function overloading
Function overloadingFunction overloading
Function overloading
 
Functions
FunctionsFunctions
Functions
 
04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdf
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
 
Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»
 
scala.reflect, Eugene Burmako
scala.reflect, Eugene Burmakoscala.reflect, Eugene Burmako
scala.reflect, Eugene Burmako
 
Function in C++
Function in C++Function in C++
Function in C++
 
FUNCTION CPU
FUNCTION CPUFUNCTION CPU
FUNCTION CPU
 
Programming style guideline very good
Programming style guideline very goodProgramming style guideline very good
Programming style guideline very good
 
Opps concept
Opps conceptOpps concept
Opps concept
 
imperative programming language, java, android
imperative programming language, java, androidimperative programming language, java, android
imperative programming language, java, android
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 

More from LISP Content

LISP: Control Structures In Lisp
LISP: Control Structures In LispLISP: Control Structures In Lisp
LISP: Control Structures In Lisp
LISP Content
 
LISP:Declarations In Lisp
LISP:Declarations In LispLISP:Declarations In Lisp
LISP:Declarations In Lisp
LISP Content
 
LISP: Errors In Lisp
LISP: Errors In LispLISP: Errors In Lisp
LISP: Errors In Lisp
LISP Content
 
LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
LISP Content
 
LISP: Object Sytstem Lisp
LISP: Object Sytstem LispLISP: Object Sytstem Lisp
LISP: Object Sytstem Lisp
LISP Content
 
LISP: Loops In Lisp
LISP: Loops In LispLISP: Loops In Lisp
LISP: Loops In Lisp
LISP Content
 
LISP: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers in lisp
LISP Content
 
LISP: Symbols and packages in lisp
LISP: Symbols and packages in lispLISP: Symbols and packages in lisp
LISP: Symbols and packages in lisp
LISP Content
 
LISP: Scope and extent in lisp
LISP: Scope and extent in lispLISP: Scope and extent in lisp
LISP: Scope and extent in lisp
LISP Content
 
LISP: Predicates in lisp
LISP: Predicates in lispLISP: Predicates in lisp
LISP: Predicates in lisp
LISP Content
 
LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
LISP Content
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
LISP Content
 

More from LISP Content (12)

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: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
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: Type specifiers in lisp
LISP: Type specifiers in lispLISP: Type specifiers in lisp
LISP: Type specifiers 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: Predicates in lisp
LISP: Predicates in lispLISP: Predicates in lisp
LISP: Predicates in lisp
 
LISP: Data types in lisp
LISP: Data types in lispLISP: Data types in lisp
LISP: Data types in lisp
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
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
 
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
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
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
 
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
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
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
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
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
 
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 -...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
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...
 
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
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
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
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

LISP: Program structure in lisp

  • 2. overview Forms Variables Macros Function calls Named functions Lambda expressions Top-level forms Declaring global variables and named constants Control of time and evaluation
  • 3.
  • 5. ListsLists can further be divided as: special forms, macro calls and function calls. All characters, numbers, string, and bit-vectors are all self-evaluating forms. When such an object is evaluated, that object is returned as the value of the form.
  • 6.
  • 7.
  • 8.
  • 9. If the macro-function is true of the symbol, apply either macro-expand or macroexpand-1, as appropriate to the entire form and then start over.
  • 10.
  • 11. Function calls While the list is being evaluated as a form, if the first element is not a symbol that names a special form or a macro, the it is considered as a function call. The first element of the list is taken as the name of the function. All the remaining elements of the list are evaluated and one value is obtained from each form, and these values become the arguments to the function. Whatever values the function returns becomes the values of the function-call forms.
  • 12. Function calls continued.. Ex: (+ 3 (* 1 2)) here, + is not a special form or macro. So 3 and (* 1 2) are considered as arguments of the function call, again 1 2 are taken as arguments of the function call (* 1 2) and the value 2 is returned. The values 2 and 3 are given as arguments for the addition function to produce the result 5. Thus, ( + 3 (* 1 2))5
  • 13.
  • 14. using a lambda-expression whose first element in the list is lambda.Lambda expressions or the symbols when used in programs as the name of the functions, can appear only as the first element of the function-call form, or the second element of the function special form. A global name can be given to a function using the defun construct. A local name is given to the function using the flet or labels construct.
  • 15. Lambda-expressions A lambda-expression has the following syntax: (lambda lambda-list .body) The first element must be lambda, the second element must be the list, and specifies names for the parameters of the list The body may consists of zero or more number of forms. Each element in the lambda-list is either a parameter specifier or the lambda-list keyword. (lambda-list keywords begin with &) Var or svar must be a symbol( the name of the variable), Each keyword must be a keyword symbol, such as :start
  • 16. A lambda-list has five parts Specifiers for the required parameters: these are parameter specifiers up to the first lambda-list keyword. Specifiers for the optional parameters: these are the specifiers following the lambda-list keyword &optional up to the next lambda-list keyword or the end of the list. A specifier for a rest parameter Specifiers for the keyword parameters Specifiers for the aux parameters: If the lambda-list keyword &key is present, all specifiers after it are auxiliary variable specifiers.
  • 17.
  • 20. Define global values for special variablesIf progn appears at top-level, then all forms within that progn are considered by the compiler to be top-level forms.
  • 21. Defining named functions defun special form is used for defining named functions. evaluating the defun form causes the symbol name to be a global name for the function specified by the lambda-expression. (defun (setf cadr)…) is used to define a setf expansion function to cadr. Forms constitute the body of the defined function, they are executed as an implicit progn. defun name lambda-list [[ {declaration}* | doc-string]] {form}*
  • 22.
  • 24. defconstant (used for defining named constants)Syntax: defvar name [initial-value [documentation]] defparameter name initial-value [documentation] defconstant name initial-value [documentation]
  • 25. (defvar variable) proclaims the variable to be special. defvar also gives a good option to provide the comment for the variable Ex: (defvar *visible-windows* 0 “number of visual windows at least partially visible on the screen”) defparameter is similar to defvar, but it requires an initial value-form, always evaluates the form, and assigns the result to the variable. defconstant is like defparameter but does assert that the value of the variable name is fixed and does license the compiler to build assumptions about the value into program being compiled.
  • 26. Control of time and execution The eval-when special code allows pieces of code to be executed only at compile-time, only at load time, or when interrupted but not compiled. eval-when ({situation}*) {from}* The body of the eval-when form is processed as an implicit progn only if the situation is a symbol, either compile, eval or load. Eval specifies that the interpreter should process the body. Compile specifies that the compiler should evaluate the body at compile time. Load specifies that the compiler should arrange to evaluate the forms in the body when the compiled file containing the eval-when form is loaded.
  • 27.
  • 28. if the situation compile is specified, or if the current processing mode is compile-time-too and the situation eval is specified, the process each of the forms in the body in compile-time-too mode.
  • 29. else, process each of the forms in the body in not-compile-time mode
  • 30. if the situation load is not specified:
  • 31. if the situation compile is specified, or if the current processing mode is compile-time-too and the situation eval is specified, then evaluate each of the forms in the body in the compiler’s executing environment.
  • 32.
  • 33. 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