Problem Set 723
- What support does Python provide for functional programming?
- What function in Ruby is used to create a curried function?
- Is the use of functional programming expanding or shrinking?
- What is one characteristic of functional programming languages that
makes their semantics simpler than that of imperative languages?
- What is the flaw in using lines of code to compare the productivity of
functional languages and that of imperative languages?
- Why can concurrency be easier with functional languages than impera-
tive languages?
PROBLEM SET
- Read John Backus’s paper on FP (Backus, 1978) and compare the
features of Scheme discussed in this chapter with the corresponding
features of FP.
- Find definitions of the Scheme functions EVAL and APPLY, and explain
their actions.
- One of the most modern and complete programming environments is
the INTERLISP system for LISP, as described in “The INTERLISP
Programming Environment,” by Teitelmen and Masinter (IEEE Com-
puter, Vol. 14, No. 4, April 1981). Read this article carefully and compare
the difficulty of writing LISP programs on your system with that of using
INTERLISP (assuming that you do not normally use INTERLISP).
- Refer to a book on LISP programming and determine what arguments
support the inclusion of the PROG feature in LISP.
- Find at least one example of a typed functional programming lan-
guage being used to build a commercial system in each of the following
areas: database processing, financial modeling, statistical analysis, and
bio-informatics.
- A functional language could use some data structure other than the list.
For example, it could use strings of single-character symbols. What
primitives would such a language have in place of the CAR, CDR, and
CONS primitives of Scheme?
- Make a list of the features of F# that are not in ML.
- If Scheme were a pure functional language, could it include DISPLAY?
Why or why not?
- What does the following Scheme function do?
(define (y s lis)
(cond
((null? lis) '() )