CHAPTER 14

FUNCTIONAL PROGRAMMING LANGUAGES

 

INTRO:

 

MATHEMATICAL FUNCTIONS

 

SIMPLE FUNCTIONS

 

FUNCTIONAL FORMS

              Ex,         h  º  f  °  g

Ex,         h(x) º x*x

then        a (h, (2, 3, 4))  yields  (4, 9, 16)

 

FUNDAMENTALS OF FUNCTIONAL PROGRAMMING LANGUAGES

 

THE FIRST FUNCTIONAL LANGUAGE: LISP

The oldest and most widely used functional language is Lisp

 

DATA TYPES AND STRUCTURES

                         Ex,      (A B C D)

                         Ex,      (A (B C) D (E (F G)))

 

THE FIRST LISP INTERPRETER

                      Ex, (function_name         arg_1 … arg_n)

 

AN INTRO TO SCHEME

42                                                               42

(* 3 7 )                                                        21

(+ 5 7 8 )                                                     20

(- 5 6 )                                                         -1

(- 15 7 2 )                                                     6

(-24 ( * 4 3 )                                                12

 

 

COMMON LISP

·         A combination of several dialects of Lisp

·         The list of features of COMMON Lisp are:

o        A large number of data types and structures, including such things as records, arrays, complex numbers, and character strings

o        Powerful input and output operations

o        A form of packages for modularizing collections of functions and data

o        Providing access control