Concepts of Programming Languages

(Sean Pound) #1
Problem Set 723


  1. What support does Python provide for functional programming?

  2. What function in Ruby is used to create a curried function?

  3. Is the use of functional programming expanding or shrinking?

  4. What is one characteristic of functional programming languages that
    makes their semantics simpler than that of imperative languages?

  5. What is the flaw in using lines of code to compare the productivity of
    functional languages and that of imperative languages?

  6. Why can concurrency be easier with functional languages than impera-
    tive languages?


PROBLEM SET



  1. 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.

  2. Find definitions of the Scheme functions EVAL and APPLY, and explain
    their actions.

  3. 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).

  4. Refer to a book on LISP programming and determine what arguments
    support the inclusion of the PROG feature in LISP.

  5. 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.

  6. 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?

  7. Make a list of the features of F# that are not in ML.

  8. If Scheme were a pure functional language, could it include DISPLAY?
    Why or why not?

  9. What does the following Scheme function do?


(define (y s lis)
(cond
((null? lis) '() )
Free download pdf