Download COS201lec52_FP

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
582713913
Page 1 of 2
COS220 Concepts of PL – Lecture 52
AUBG, COS dept
Lecture 52
Theory
Programming Styles. Functional Programming.
The concept of a function. Basic principles of functional programming.
Expressions evaluation. The LISP machine infinite loop: Read, Evaluate,
Write. Describing user defined names and functions.
RS 6th , 7th ed., Chapter 15
Functional Programming: COMPOSITION OF FUNCTIONS = PROGRAMS
The concept of a function as a relation or a mapping. Higher order functions (functional
forms):
Composition,
Construction,
Applytoall.
Basic principles of functional programming:
a base set of primitive, standard, generic functions;
a mechanism to build new functions using old functions or base set functions.
Pure LISP data structures: atoms and lists:
Atoms are symbols that have the form of identifiers or numeric constants;
Lists are specified by delimiting their elements within parentheses.
Expressions evaluation. The LISP machine infinite loop:
Read;
Evaluate;
Write.
Describing user defined names and functions. Functions for constructing functions.
Control flow. Function definition using lambda notation.
List processing functions: Selectors car, cdr. Constructor cons. Predicates null, atom.
Exercise
52a
Theory
Programming Styles. Functional Programming.
Basic elements of SCHEME LISP. Defining user functions.
Assignments under discussion are based on lecture 52.
Task 1. Describe in functional list notation a function that returns the value of an element
numbered n from the Fibonacci sequence.
Task 2. Describe in functional list notation a function that returns the factorial of an
integer value n.
Task 3. Describe in functional list notation a function that returns the greatest common
divisor of two integer numbers.
http://www.tiobe.com/index.htm?tiobe_index
Page 2 of 2
TIOBE Programming Community Index for November 2012
Headline: Objective-C on its way to become "language of the year" again
Position
Position
Delta in Position
Ratings
Delta
Nov 2012
Nov 2011
Programming Language
Status
Nov 2012
Nov 2011
1
2
C
19.224%
+1.90%
A
2
1
Java
17.455%
-0.42%
A
3
6
Objective-C
10.383%
+4.40%
A
4
3
C++
9.698%
+1.61%
A
5
5
PHP
5.732%
-0.36%
A
6
4
C#
5.591%
-1.73%
A
7
7
(Visual) Basic
5.032%
-0.01%
A
8
8
Python
4.062%
+0.45%
A
9
10
Perl
2.182%
+0.10%
A
10
11
Ruby
1.739%
+0.24%
A
11
9
JavaScript
1.278%
-1.29%
A
12
16
Delphi/Object Pascal
0.995%
+0.12%
A
13
13
Lisp
0.951%
-0.23%
A
14
14
Pascal
0.881%
-0.11%
A
15
23
Visual Basic .NET
0.769%
+0.24%
A-
16
19
Ada
0.662%
+0.04%
B
17
12
PL/SQL
0.632%
-0.81%
B
18
18
Lua
0.631%
0.00%
A-
19
15
MATLAB
0.620%
-0.34%
B
20
24
Assembly
0.585%
+0.06%
B
Related documents