> (P 5 2) 120 > (P 5 3) 543 > (P1 5 3) 543 > (P2 5 3) 63 > (P3 5 3) 2005 > (P4 5 3) 179 > (P4 5 3) 543 > (accumulate + 0 1 10 id 1+) 55 > (accumulate-l + 0 1 10 id 1+) 55 > > (P5 5 3) 63 > (P5 5 3) 543 > > (fact 5) 120 > (pow 2 5) [image] [image] application: not a procedure; expected a procedure that can be applied to arguments given: 2 > (pow 2 5) [image] [image] ...cheme/highorder.scm:37:22: arity mismatch; the expected number of arguments does not match the given number expected: 0 given: 1 > (pow 2 5) 32 > (pow 2 100) 1267650600228229401496703205376 > (myexp 2 10) 34913/4725 > (+ .0 (myexp 2 10)) 7.388994708994709 > (exp 2) 7.38905609893065 > (+ .0 (myexp 2 100)) 7.38905609893065 > (+ .0 (myexp 2 100)) 7.38905609893065 > (+ .0 (myexp2 2 100)) 7.38905609893065 [image] or: bad syntax in: or > (exists? odd? 1 5) #t > (exists? odd? 2 2) #f > (twice square) > (define squaresquare (twice square)) > squaresquare # > (squaresquare 3) 81 > ((twice square) 3) 81 > ((compose 1+ (compose square (n+ 2))) 3) 26 > ((compose (compose 1+ square) (n+ 2)) 3) 26 > > 2* # > (2* 2) 4.009999999999891 > ((derive (derive square 0.0001) 0.001) 3) 2.0000000056086265 > ((derive (derive (lambda (x) (* x x x)) 0.0001) 0.001) 3) 18.00330000634176 > > (repeated square 3) # > ((repeated square 3) 2) [image] [image] *: contract violation expected: number? given: # > ((repeated square 3) 2) 256 > (repeated square 3) # > ((repeated square 3) 2) 256 > ((repeated square 3) 2) 256 > ((derive-n (lambda (x) (* x x x)) 2 0.001) 3) 18.006000004788802 > ((derive-n sin 5 0.00001) 0) 122124.53269877518 > ((derive-n sin 5 0.001) 0) 1.000310945187266 > ((derive-n sin 5 0.001) 0) [image] [image] derive: arity mismatch; the expected number of arguments does not match the given number expected: 2 given: 1 > ((derive-n sin 5 0.001) 0) [image] [image] repeated: arity mismatch; the expected number of arguments does not match the given number expected: 2 given: 3 > ((derive-n sin 5 0.001) 0) # > ((derive-n sin 5 0.001) 0) [image] [image] ...cheme/highorder.scm:56:2: arity mismatch; the expected number of arguments does not match the given number expected: 1 given: 0 > > ((derive-n sin 5 0.001) 0) 1.000310945187266