Oppimateriaalin copyright © 2007 Arto Wikla. Tämän oppimateriaalin käyttö on sallittu vain yksityishenkilöille opiskelutarkoituksissa. Materiaalin käyttö muihin tarkoituksiin, kuten kaupallisilla tai muilla kursseilla, on kielletty.

581362 Ohjelmointikielten periaatteet keväällä 2007: 5. harjoitukset 20.2.

  1. [Modified from Scott's Review Questions for Chapter 10, Vihavainen] Answer the following questions concerning programming languages:

    1. What mathematical formalism underlies functional programming? Give a sample of this notation, and explain it.
    2. What is a higher-order function (also known as a functional form)?
    3. What does it mean for a language to be homoiconic? Give an example of a homoiconic programming language.
    4. What does it mean for a function to be strict?
    5. Why do both functional and logic programming languages make such heavy use of lists?
    6. What is the trivial update problem in functional programming?
    7. Summarize the arguments for and against side-effect-free programming.

  2. [Modified from Scott 10.2] It is possible to write programs in a purely functional subset of an imperative language such as C/C++, but certain limitations of the language quickly become apparent. What features would need to be added to your favorite imperative language to make it genuinely useful as a functional language? Hint: What does Scheme have that C/C++ lacks?

  3. [Scott 10.3] Some authors characterize functional programming as one form of declarative programming. Others characterize functional programming as a separate computational model, co-equal with imperative and declarative programming. Which characterization do you prefer? Why?

  4. [Scott's Review Questions for Chapter 11] Answer the following questions concerning programming languages:
    1. What mathematical formalism underlies logic programming?
    2. What is a Horn clause?
    3. Briefly describe the process of resolution in logic programming.
    4. What is unification? Why is it important in logic programming?
    5. What are clauses, terms, and structures in Prolog? What are facts, rules, and queries?
    6. Explain how Prolog differs from imperative languages in its handling of arithmetic?

  5. [Scott's Review Questions for Chapter 13] Answer the following questions concerning programming languages:
    1. What is the most widely used scripting language?
    2. What is the Perl motto?
    3. List several distinctive features of Python.
    4. Explain the distinction between server-side and client-side web scripting.
    5. Why might we prefer to to execute a web script on the server rather than the client? Why might we sometimes prefer the client instead?
    6. What is the relationship of between JavaScript and Java?
    7. What popular scripting language uses dynamic scope?
    8. Summarize the strategies used in Perl, PHP, Ruby, and Python to determine the scope of variables that are not declared.
    9. Contrast the philosophies of Perl and Ruby with regard to error checking and reporting.

  6. [Tämäkin on ihan "oikea", rastittava tehtävä. Olkaa luotettavia ja vastatkaa kyselyyn vaikka emme sitä pystykään varmistamaan! ;-]
    Vastaa kurssikyselyyn niiltä osin kuin kurssin tässä vaiheessa voit. Koetta koskeviin kysymyksiin ei tietenkään vielä voi vastata. Samoin artikkeliin, esitelmään, opponointiin ja pikaoppaan laatimiseen liittyviin kysymyksiin voi tässä vaiheessa kirjoittaa vain etukäteisarvioita. Tässä vaiheessa palautetta siis pyydetään kurssin perinteisen muotoisesta alkuosasta. Loppukeväästä kysely vielä uusitaan. Silloin palautetta halutaan ennen kaikkea kurssin jälkipuoliskosta.


Takaisin harjoitusten pääsivulle.