SlideShare a Scribd company logo
7
Most read
10
Most read
13
Most read
Scheme Functional Programming Language
CSC 337
Concepts of Programming Languages
Qassim University
College of Computer –IT department
Ms.Sadaf Ambreen Abbasi.
Reham AL blihed
Muna AL rajhi
Outline
• About Scheme programming language
• A Simple Idea of Scheme Program
• Type Primitive Numeric Functions
• Type Predicates
• General Example of Scheme Language
About Scheme programming language
Scheme
• is primarily a functional programming language. It shares many
characteristics with other members of the Lisp programming
language family. Scheme's very simple syntax.
• The Scheme language, which is a dialect of LISP, was developed in
the mid-1970s.
A Simple Idea of Scheme Program
• Some of the differences between Scheme program and C program.
CScheme
(2 + 3 + 4)(+ 2 3 4)Arithmetic operations
((2 * 3) + (4 * 5))(+ (* 2 3) (* 4 5))Arithmetic operations
int sq(int x) { return (x * x) }(define (sq x) (* x x))Function
Type Primitive Numeric Functions :
• Scheme includes primitive functions for the basic arithmetic operations. These are +, −,
*, and /, for add, subtract, multiply, and divide.
• Expressions are written in the form
(function_name arguments)
Example Expression with Parameter & without Parameter Example of numeric function:
Type Predicates Functions.
• A Rredicate Functions is a boolean functions (some representation
of either true or false)
General Example of Scheme Language
• Example: using special form cond
General Example of Scheme Language
Power
• The Power Function use mathematical induction and then translate that
definition using recursion.
Exponentiation (assume m ≠0)
m^0 = 1
m^n = m • m^n-1 for n>0
Example:
General Example of Scheme Language
• Max of three number
Example:
General Example of Scheme Language
• Categorize
• Categorize is function to check if number positive or negative or zero.
General Example of Scheme Language
• Sum of the members of a list
• Parameter: a list of numbers.
• Result: the sum of all the numbers in the list.
Example:
General Example of Scheme Language
• Length
• Example:
• The recursion used in length is called "cdr-recursion".
• –At each step, a shorter list is passed to the next function call.
General Example of Scheme Language
• Filter
• Filter function built-in scheme, which takes a predicate and a list
and returns those elements of the list for which the predicate is
true.
Example:

More Related Content

PPT
UNIT-1-PPTS-DAA.ppt
PPT
Greedy Algorihm
PPTX
Three Address code
PDF
P, NP, NP-Complete, and NP-Hard
PPTX
Three address code In Compiler Design
PPT
Intermediate code generation (Compiler Design)
PPT
Lower bound
PPT
Complexity of Algorithm
UNIT-1-PPTS-DAA.ppt
Greedy Algorihm
Three Address code
P, NP, NP-Complete, and NP-Hard
Three address code In Compiler Design
Intermediate code generation (Compiler Design)
Lower bound
Complexity of Algorithm

What's hot (20)

PPTX
Complexity analysis in Algorithms
PPTX
Greedy algorithms
PDF
14-Intermediate code generation - Variants of Syntax trees - Three Address Co...
PPT
PPT
Memory allocation (4)
PPTX
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
PPT
1.1 binary tree
PPTX
Lec 2 algorithms efficiency complexity
PPTX
Pumping lemma
PPT
Heuristic Search Techniques {Artificial Intelligence}
PPTX
Priority Queue in Data Structure
PPTX
Chapter 09 design and analysis of algorithms
PPT
SINGLE-SOURCE SHORTEST PATHS
PPT
Binary Search
PPTX
State space search
PDF
Quick sort algorithn
PPTX
Brute force method
PDF
Symbol table in compiler Design
PPTX
OOPS In JAVA.pptx
PPTX
Finite automata-for-lexical-analysis
Complexity analysis in Algorithms
Greedy algorithms
14-Intermediate code generation - Variants of Syntax trees - Three Address Co...
Memory allocation (4)
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
1.1 binary tree
Lec 2 algorithms efficiency complexity
Pumping lemma
Heuristic Search Techniques {Artificial Intelligence}
Priority Queue in Data Structure
Chapter 09 design and analysis of algorithms
SINGLE-SOURCE SHORTEST PATHS
Binary Search
State space search
Quick sort algorithn
Brute force method
Symbol table in compiler Design
OOPS In JAVA.pptx
Finite automata-for-lexical-analysis
Ad

Similar to Scheme Programming Language (20)

PPTX
Funtional Programming
PPTX
Scheme language
PPT
Lisp and scheme i
PDF
The Scheme Programming Language 4th Fourth Edition R K Dybvig R Kent Dybvig
PPTX
Principles of programming language intro
PDF
Clqr a4-consec
PPTX
Plc part 3
PPT
INTRODUCTION TO LISP
PPTX
What is c
PPT
expressions
PDF
15 functional programming
PDF
15 functional programming
PPTX
Teaching algebra through functional programming
PDF
The Scheme Language -- Using it on the iPhone
PDF
iRODS Rule Language Cheat Sheet
PPT
Functions & Procedures [7]
DOCX
Functions Practice Sheet.docx
PPS
Learn C
PPTX
AI Programming language (LISP)
DOC
c.p function
Funtional Programming
Scheme language
Lisp and scheme i
The Scheme Programming Language 4th Fourth Edition R K Dybvig R Kent Dybvig
Principles of programming language intro
Clqr a4-consec
Plc part 3
INTRODUCTION TO LISP
What is c
expressions
15 functional programming
15 functional programming
Teaching algebra through functional programming
The Scheme Language -- Using it on the iPhone
iRODS Rule Language Cheat Sheet
Functions & Procedures [7]
Functions Practice Sheet.docx
Learn C
AI Programming language (LISP)
c.p function
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Unlocking AI with Model Context Protocol (MCP)
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Empathic Computing: Creating Shared Understanding
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Unlocking AI with Model Context Protocol (MCP)

Scheme Programming Language

  • 1. Scheme Functional Programming Language CSC 337 Concepts of Programming Languages Qassim University College of Computer –IT department Ms.Sadaf Ambreen Abbasi. Reham AL blihed Muna AL rajhi
  • 2. Outline • About Scheme programming language • A Simple Idea of Scheme Program • Type Primitive Numeric Functions • Type Predicates • General Example of Scheme Language
  • 3. About Scheme programming language Scheme • is primarily a functional programming language. It shares many characteristics with other members of the Lisp programming language family. Scheme's very simple syntax. • The Scheme language, which is a dialect of LISP, was developed in the mid-1970s.
  • 4. A Simple Idea of Scheme Program • Some of the differences between Scheme program and C program. CScheme (2 + 3 + 4)(+ 2 3 4)Arithmetic operations ((2 * 3) + (4 * 5))(+ (* 2 3) (* 4 5))Arithmetic operations int sq(int x) { return (x * x) }(define (sq x) (* x x))Function
  • 5. Type Primitive Numeric Functions : • Scheme includes primitive functions for the basic arithmetic operations. These are +, −, *, and /, for add, subtract, multiply, and divide. • Expressions are written in the form (function_name arguments) Example Expression with Parameter & without Parameter Example of numeric function:
  • 6. Type Predicates Functions. • A Rredicate Functions is a boolean functions (some representation of either true or false)
  • 7. General Example of Scheme Language • Example: using special form cond
  • 8. General Example of Scheme Language Power • The Power Function use mathematical induction and then translate that definition using recursion. Exponentiation (assume m ≠0) m^0 = 1 m^n = m • m^n-1 for n>0 Example:
  • 9. General Example of Scheme Language • Max of three number Example:
  • 10. General Example of Scheme Language • Categorize • Categorize is function to check if number positive or negative or zero.
  • 11. General Example of Scheme Language • Sum of the members of a list • Parameter: a list of numbers. • Result: the sum of all the numbers in the list. Example:
  • 12. General Example of Scheme Language • Length • Example: • The recursion used in length is called "cdr-recursion". • –At each step, a shorter list is passed to the next function call.
  • 13. General Example of Scheme Language • Filter • Filter function built-in scheme, which takes a predicate and a list and returns those elements of the list for which the predicate is true. Example: