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.
-
[Modified from Scott's Review Questions for Chapter 10, Vihavainen]
Answer the following questions concerning programming languages:
-
What mathematical formalism underlies functional programming?
Give a sample of this notation, and explain it.
-
What is a higher-order function (also known as a functional
form)?
-
What does it mean for a language to be homoiconic?
Give an example of a homoiconic programming language.
-
What does it mean for a function to be strict?
-
Why do both functional and logic programming languages make such heavy
use of lists?
-
What is the trivial update problem in functional programming?
-
Summarize the arguments for and against side-effect-free
programming.
-
[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?
- [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?
- [Scott's Review Questions for Chapter 11] Answer the
following questions concerning programming languages:
- What mathematical formalism underlies logic programming?
- What is a Horn clause?
- Briefly describe the process of resolution in logic programming.
- What is unification? Why is it important in logic programming?
- What are clauses, terms, and structures in Prolog?
What are facts, rules, and queries?
- Explain how Prolog differs from imperative languages in its handling
of arithmetic?
- [Scott's Review Questions for Chapter 13] Answer the
following questions concerning programming languages:
- What is the most widely used scripting language?
- What is the Perl motto?
- List several distinctive features of Python.
- Explain the distinction between server-side and client-side
web scripting.
- 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?
- What is the relationship of between JavaScript and Java?
- What popular scripting language uses dynamic scope?
- Summarize the strategies used in Perl, PHP, Ruby, and Python to
determine the scope of variables that are not declared.
- Contrast the philosophies of Perl and Ruby with regard to error
checking and reporting.
- [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.