a08sol-cs135-w10

a08sol-cs135-w10 - ;; EEELGHHEF: Up EULICiflhS ;; ERA}...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ;; EEELGHHEF: Up EULICiflhS ;; ERA} LUEHHEK WiKTLE 2321 ;; s—eeerds : {iistef pesn] —} {iisLei nsmi ;; Returns the n—eeerdinetes frem the given list ei eesns ;; lseipies: {cheek—expect {s—eddrds empty} empty} {eheek—espeet {s—ederds {list {mske—pdsn l 2}}} {list 1}} {define {s—eeerds sldp} {map pesn—s sldp}} ;; s—eeerds—ef—pesns: {i_sLei Any] —} {i_sLei num} ;; Retsrns the s—eeerninetes ef the pesns in the given list ;; lsempies: {cheek—expect {s—eddrds—df—pesns empty} empty} {eheek—espeet {s—ederds—df—pesns '{l}} empty} {eheek—espeet {s—ederds—df—pesns {list {mske—pesn l 2}}} {list 1}} {define {s—eeerds—df—pesns slst} {map pesn—s {filter pesn? slst}}} ;; slternsL_ng—snm : {iiStei 34m} —} Hum ;; Returns the siternetine sum ef the numhers _n the qiyenEL'st ;; lseipies: {eheek—espeet {alternating—sum empty} D} {cheek—expect {alternating—sum T{1}} l} {eheek—espeet {alternating—sum T{l 2}} —l} \ {define {alternating—sum slen} {feldr — U sldn}}\) !//p iiii::> ;; first—eel: {iistef {i_sLei numJ} —} {list I F; Retsrns the iirsL eeismn ef the given- ;; lsempies: {cheek—expect {first—eel empty} emp y} {eheek—espeet {first—eel T{{l}}} {l' t l} {eheek—espeet {first—eel ’{{l 2} 3 fl}}} {define {first—eel mstrs} {msp fifst'meELH} ;; sdnL—msi: {lisief {iiStei Isfi] —} il_sLei {iiStef num}] ;; ass: ; Le every entry ef the giyei metris ;; lseipies: {eheek—espeet {sddl—mst empty} empty} {cheek—expect {sddl—mst '{{l}}} '{{2}}} {eheek—espeet {sddl—mst '{{l 2} {3 fl}}} T{{2 3} {4 5}}} {define {sddl—mst m} {map {lsmhds {r} {msp sddl r}} m}} ;; sum—et—sere : {iistef {14: —s KJmJ} —} ism ;; Retsrns the sum ehteined ire: eyeiset_ng eeeh isnetien in the give: list ;; st 0, snd.iisfli edd_ng. ;; rssmpies: {eheek—espeet {snm—st—sere empty} 0} {eheek—espeet {snm—st—sere {list sddl}} l} {eheek—espeet {snm—st—sere {list sddl sqr sddli} 2} {define {sum—st—sere sldf} {feldr {lsmhds {s y} {+ {s U} y}} D sldf}} ;; iirsL—pesiLiVe—eL—sere : {neiistef {ism —s humii —s {Hum —} Hum} This document is for the exclusive use of x284”. ;: .KELULTHE Lite i iral. Innfu.ien _;2 LEE: givenl _ia;. Wflififll ia gaiailu_ve {dial ;: euaiua ed aL E. {define {first—pesitive—at—zere alef} {first {filter {lambda {f} {h {f D} 0}} alef}}} ; : a {a- ~line : {E —:b :inrn} {ii -} .nlffl} —:» {a —;3 :lJflli ;: Erndunea zine aufllfflf Lne Lab gimenl fnnnLinna ;: laafn_ea: {cheek—expect {{add—funea addl addl} 5} 12} {define {add—funea f g} {lambda {a} {+ {f a} {g a}}}} ;: add—fane—iia : {liaLnf {a —} nui}} —h {H —h bum} ;: Eredu£E¥3 ;he aufllfflf Lne giveELILnntfiene _:;;Jne lie; ;: laamb_ea {ebeek—eapeet {{add—fune—liat empty} 5} U} {cheek—expect {{add—fune—liat {list addl}} 5} E} {ebeek—eapeet {{add—fune—liat {list addl addl addl}} 5} 18} {define {add—fune—liat alef} {feldr add—funds {lambda {a} g& alef}} {define {e—rrnat ej} {{ej addl} {n} w / {define {nat—ee n} - » {eend _ [{zere? n} {lambda {f} {lambda {a a}}] [elae {lambda {f} {lambda {n} {f {{na —}C nbl n}} f} E}}}}]}} {define {e+ ei Cj} .“m \ {lambda {f} {lambda {a} {{ei f} "Haj-«£47 {1}} This document is for the exclusive use of x284”. ...
View Full Document

This note was uploaded on 10/02/2011 for the course CS 135 taught by Professor Vasiga during the Winter '07 term at Waterloo.

Page1 / 2

a08sol-cs135-w10 - ;; EEELGHHEF: Up EULICiflhS ;; ERA}...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online