X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=assignment4.mdwn;fp=assignment4.mdwn;h=74238062bb73a517a0e6f350d9fbaa0089dfc383;hp=34fb044d6197fd875e56a4f15ecc26bc2a233e37;hb=0ee4fffb00fe8d2ea489416173909e6ef06fbefb;hpb=c447066469179d42ed05d7a7996b9bb7be60e001 diff --git a/assignment4.mdwn b/assignment4.mdwn index 34fb044d..74238062 100644 --- a/assignment4.mdwn +++ b/assignment4.mdwn @@ -1,13 +1,12 @@ -Assignment 4 ------------- - #Reversing a list# -How would you define an operation to reverse a list? (Don't peek at the +1. How would you define an operation to reverse a list? (Don't peek at the [[lambda_library]]! Try to figure it out on your own.) Choose whichever implementation of list you like. Even then, there are various strategies you can use. +(See [[hints/Assignment 4 hint 1]] if you need some hints.) + #Comparing lists for equality# @@ -28,13 +27,17 @@ let list_equal = ; (might_for_all_i_know_still_be_equal?, tail_of_reversed_right) ; when left is empty, the lists are equal if right is empty (make_pair - (not (isempty right)) + true ; for all we know so far, they might still be equal (reverse right) ) ; when fold is finished, check sofar-pair (\might_be_equal right_tail. and might_be_equal (isempty right_tail)) --> +#Mutually-recursive functions# + + + #Enumerating the fringe of a leaf-labeled tree# [[Implementing trees]]