X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment3.mdwn;h=5bee7a43484f71cbf42f3016132caafac4489920;hp=57b6d4d82e668da5ebe1f4889cbdae910adbfc23;hb=cff9857e52ac59c4905efeb80fcf8a91c2fd1ed8;hpb=57be0c4918eef2e0441645bb32464bedc94c6477 diff --git a/exercises/assignment3.mdwn b/exercises/assignment3.mdwn index 57b6d4d8..5bee7a43 100644 --- a/exercises/assignment3.mdwn +++ b/exercises/assignment3.mdwn @@ -1,5 +1,3 @@ -** *Work In Progress* ** - ## Lists and List Comprehensions 1. In Kapulet, what does `[ [x, 2*x] | x from [1, 2, 3] ]` evaluate to? @@ -18,6 +16,7 @@ 8. Suppose you have two lists of integers, `left` and `right`. You want to determine whether those lists are equal, that is, whether they have all the same members in the same order. How would you implement such a list comparison? You can write it in Scheme or Kapulet using `letrec`, or if you want more of a challenge, in the Lambda Calculus using your preferred encoding for lists. If you write it in Scheme, don't rely on applying the built-in comparison operator `equal?` to the lists themselves. (Nor on the operator `eqv?`, which might not do what you expect.) You can however rely on the comparison operator `=` which accepts only number arguments. If you write it in the Lambda Calculus, you can use your implementation of `leq`, requested below, to write an equality operator for Church-encoded numbers. [[Here is a hint|assignment3 hint3]], if you need it. + (The function you're trying to define here is like `eqlist?` in Chapter 5 of *The Little Schemer*, though you are only concerned with lists of numbers, whereas the function from *The Little Schemer* also works on lists containing symbolic atoms --- and in the final version from that Chapter, also on lists that contain other, embedded lists.) ## Numbers