7.0

Week 7 Set b

home work!

Programming Language ISL+

Due Date Thursday 10/18 at 9:00pm (Week 7)

Purpose To begin using λ.

Language change!

As noted above, please submit this assignment in Intermediate Student Language with Lambda as opposed to ISL.

Finger Exercises

Exercise 1 From HTDP, 279 280 281

Graded Exercises

Exercise 2 Design a function using the appropriate pre-defined abstraction as well as λ which determines if every posn’s y-coordinate in a list of posns is below a given number.

Exercise 3 As it turns out, many of the pre-defined abstractions we know and love can take more than one input list, so long as the list lengths are the same and the function given can take as many arguments as there are lists. Armed with this knowledge, as well as λ, design a function hyphenate, which given two lists of strings (assumed to be of the same length), produces a list of strings, where each element is of the form "s1-s2", where "s1" is originally from the first given list and "s2" is originally from the second given list. Note this means the first element from the first list is paired with the first from the second, the second is paired with the second, etc (i.e., this is not the cartesian product).

Exercise 4 Design a function bigger-transformation, that given two [Number -> Number] functions, produces a new [Number -> Number] function whose output is the larger of the results of applying the initial functions to some input. Remember, when testing a function that produces a function, one must use the result as function equality cannot be tested! Also, be sure to use λ where appropriate.