.. _FP5:
.. raw:: html
.. |--| unicode:: U+2013 .. en dash
.. |---| unicode:: U+2014 .. em dash, trimming surrounding whitespace
:trim:
.. This file is part of the OpenDSA eTextbook project. See
.. http://algoviz.org/OpenDSA for more details.
.. Copyright (c) 2012-13 by the OpenDSA Project Contributors, and
.. distributed under an MIT open source license.
.. avmetadata::
:author: David Furcy and Tom Naps
===========================================
Functional Programming - Part 5 (F 2/19/16)
===========================================
RP 9 part 1
-----------
Topics of the day:
1. Scoping (in general and in JS)
2. Static versus dynamic binding
3. Higher-order functions
4. Closures
5. Anonymous functions
The review problem set for today contains four review problems.
This first problem is about higher-order functions and uses closures
and anonymous functions. This problem is randomized. You must solve it
correctly three times in a row.
.. avembed:: Exercises/PL/RP9part1.html ka
:module: FP5
:long_name: RP set #9, question #1
:points: 1.0
:required: True
:threshold: 3.0
:exer_opts: JXOP-debug=true&JOP-lang=en
RP 9 part 2
-----------
This problem is about higher-order functions and scoping rules. It uses
closures and anonymous functions.
.. avembed:: Exercises/PL/RP9part2.html ka
:module: FP5
:long_name: RP set #9, question #2
:points: 1.0
:required: True
:threshold: 1.0
:exer_opts: JXOP-debug=true&JOP-lang=en
RP 9 part 3
-----------
This problem uses the same code as the previous problem and illustrates
the same topics.
.. avembed:: Exercises/PL/RP9part3.html ka
:module: FP5
:long_name: RP set #9, question #3
:points: 1.0
:required: True
:threshold: 1.0
:exer_opts: JXOP-debug=true&JOP-lang=en
RP 9 part 4
-----------
This problem uses the same code as the previous two problems but
focuses on the difference between static and dynamic binding rules.
.. avembed:: Exercises/PL/RP9part4.html ka
:module: FP5
:long_name: RP set #9, question #4
:points: 1.0
:required: True
:threshold: 1.0
:exer_opts: JXOP-debug=true&JOP-lang=en