.. _FP1: .. 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 1 =========================================== .. (W 2/10/16) RP 5 part 2 ----------- Topics of the day: 1. How to add annotations to a Jison grammar to produce an interpreter, rather than just a parser (see previous chapter) 2. Introduction to functional programming The review problem set for today contains five review problems. The first one (see previous chapter) is about grammars. The four remaining problems are in this section. This problem deals with the syntax and semantics of the ``fp.cons`` function. .. avembed:: Exercises/PL/RP5part2.html ka :module: FP1 :points: 1.0 :required: True :threshold: 5.0 :exer_opts: JXOP-debug=true&JOP-lang=en&JXOP-code=java :long_name: RP set #5, question #2 RP 5 part 3 ----------- This problem deals with the semantics of the ``fp.hd``, ``fp.tl``, and ``fp.cons`` functions. Note that this problem is randomized. You must solve it correctly three times in a row to earn the point associated with it. .. avembed:: Exercises/PL/RP5part3.html ka :module: FP1 :points: 1.0 :required: True :threshold: 5.0 :exer_opts: JXOP-debug=true&JOP-lang=en&JXOP-code=java :long_name: RP set #5, question #3 RP 5 part 4 ----------- This problem deals with the syntax and semantics of the ``fp.hd``, ``fp.tl``, and ``fp.isEq`` functions. .. avembed:: Exercises/PL/RP5part4.html ka :module: FP1 :points: 1.0 :required: True :threshold: 5.0 :exer_opts: JXOP-debug=true&JOP-lang=en&JXOP-code=java :long_name: RP set #5, question 4 RP 5 part 5 ----------- This problem once more helps you review the semantics of the ``fp.hd``, ``fp.tl``, and ``fp.cons`` functions. .. avembed:: Exercises/PL/RP5part5.html ka :module: FP1 :points: 1.0 :required: True :threshold: 5.0 :exer_opts: JXOP-debug=true&JOP-lang=en&JXOP-code=java :long_name: RP set #5, question 5