Oppimateriaalin copyright © 2009 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.
Ohjelmointikielten periaatteet keväällä 2009: 5. harjoitukset
-
[Modified from Scott's Review Questions for Chapter 10]
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?
-
Summarize the arguments for and against side-effect-free
programming.
-
[Strongly modified from Scott 10.2]
It is possible to write programs in a purely functional subset of
an imperative language such as Java, but certain limitations of the
language quickly become apparent. What features would need to be added
to a classical imperative language to make it genuinely useful
as a functional language?
Hint: What does Scala have that Java lacks?
- Explain the terms closure and currying in Scala language.
Give program examples of situations, where these techniques feel natural and
lead to clear program structure.
- [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 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 Perl motto?
- 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?
- [*]Contrast the philosophies of Perl and Ruby with regard to error
checking and reporting.
-
[*]
[Tämäkin on ihan "oikea", rastittava tehtävä,
johon vastaamisesta vain ilmoitetaan ohjaajalle.
Olkaa luotettavia ja vastatkaa kyselyyn vaikka emme sitä
pystykään varmistamaan! ;-]
(Niin ja tähän siis vastataan ihan itse, ei ryhmänä. ;-)
Vastaa
kurssikyselyyn niiltä osin voit --
koetta koskeviin kysymyksiin ei tietenkään voi vastata.
Takaisin harjoitusten pääsivulle.