ࡱ> =?< +jbjbgg   +NN$$$$$8 $DDDDDDDDhDDDDHDDL:DDDVTVqYv$^5  0ATDDDN :   Name: ___________________________ Scheme Syntax Quiz 1 9 Feb, 2010 This quiz is closed-book, closed-notes, closed-computers, and you have twenty minutes to do it. Write a Scheme expression containing a simple picture, and producing three copies of that picture, side by side, with the middle one upside-down. Show the sequence of steps that the Stepper would take in evaluating this expression. At each step, underline the sub-expression that's about to be replaced. Define a function named "hdiamond" which takes in a string (the color of the diamond) and a number (the length of one of its sides) and produces a horizontal diamond shape, i.e. a left-pointing triangle connected at the base to a right-pointing triangle. For example,  Remember to follow the steps of the design recipe: contract/purpose, examples, skeleton, inventory, body. (Skip the "testing" step, since you can't do it on paper.) Copy your function definition (not the contract or examples) from the previous page, then draw a box diagram to show that your definition is a legal Scheme expression. You may refer to the following syntax rules by number: Syntax Rule 1: Any picture, number, or string is a legal expression. Syntax Rule 2: A left-parenthesis followed by a function name, one or more legal expressions, and a right parenthesis, is a legal expression. Pattern: ( function-name expr ) Syntax Rule 3: Any identifier, if already defined, is a legal expression. Syntax Rule 4: A left-parenthesis followed by the word define, a previously-undefined identifier, a legal expression, and a right-parenthesis is a legal expression. Pattern: ( define new-identifier expr ) Syntax Rule 5: A left-parenthesis followed by the word define, a left-parenthesis, a previously-undefined identifier, one or more identifiers, a right-parenthesis, a legal expression, and another right-parenthesis is a legal expression. Pattern: (define ( new-identifier identifier ...) expr ) Note that the identifiers from the function header can appear inside the function body as though they were defined variables. 9D9 A [ t   ? x U ȼյյՉՉՉՉյյyk^k^hKh%HOJPJQJhKh%H5OJPJQJhKh%H5jh%HUh%HOJQJ!hKh%HB*OJPJQJph$hKh%H5B*OJPJQJph hKh%HhKh%H5OJQJhKh%HCJOJQJhKh%HOJQJhKhKOJQJh~<OJQJhKhKCJOJQJ$"#$9EFA x n +,$d%d&d'd1$7$8$H$NOPQgd%H $ & Fa$gd%H$a$gd%H$a$$a$U W k | gp|*+hKh%HOJQJ hKh%HhKh%HOJP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xqpR9dNVhm ƩC튔/j؛03 ԥCĕGZ26 (bE<[GqDF3 .'G>8=נÅ3Y8QTXc*׌[N"j:Δxn {X cUwkr(JlsY?s6;`i髁4|߄`7TOjE Y ҉q8F#u}Ucsgpz!cd(jRzkgM@.UXľ4b6'\w2?e~+F%Y8چߗb;˃"͍ awd8αJ싚,MỌ`<-D"̥ˤTEI$I|'MҸ6i&47ԢHMD J47Q@ ]&6iےO|a턃FeRλ"Դ?YpLh__Gzñ5Xia1Fo8V њhMb />yֶ1M! otav#YT|߶!n$D1 ?5R&}. ʇZǹ(O ~i/: @hص^(ΐR1R{ǖQ*S{ )¢ydXOHDц>$2R*BʰCEHv fLIENDB`666666666vvvvvvvvv666666>6666666666666666666666666666666666666666666666666hH6666666666666666666666666666666666666666666666666666666666666666666666666662 0@P`p2( 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p8XV~ OJPJQJ_HmH nH sH tH <`< NormalCJ_HmH sH tH DA D Default Paragraph FontZiZ  Table Normal :V 4 l4a _H(k (No List 0>@0 Title$a$CJ$6J@6 Subtitle$a$CJ2B2 Body TextCJPK![Content_Types].xmlN0EH-J@%ǎǢ|ș$زULTB l,3;rØJB+$G]7O٭Vsקo>W=n#p̰ZN|ӪV:8z1f؃k;ڇcp7#z8]Y / \{t\}}spķ=ʠoRVL3N(B<|ݥuK>P.EMLhɦM .co;əmr"*0#̡=6Kր0i1;$P0!YݩjbiXJB5IgAФ޲a6{P g֢)҉-Ìq8RmcWyXg/u]6Q_Ê5H Z2PU]Ǽ"GGFbCSOD%,p 6ޚwq̲R_gJSbj9)ed(w:/ak;6jAq11_xzG~F<:ɮ>O&kNa4dht\?J&l O٠NRpwhpse)tp)af] 27n}mk]\S,+a2g^Az )˙>E G鿰L7)'PK! ѐ'theme/theme/_rels/themeManager.xml.relsM 0wooӺ&݈Э5 6?$Q ,.aic21h:qm@RN;d`o7gK(M&$R(.1r'JЊT8V"AȻHu}|$b{P8g/]QAsم(#L[PK-![Content_Types].xmlPK-!֧6 0_rels/.relsPK-!kytheme/theme/themeManager.xmlPK-!\theme/theme/theme1.xmlPK-! ѐ' theme/theme/_rels/themeManager.xml.relsPK] +U + + --ei-S^U_ go-:::::: &% 7Kxڝhh^h`o()^`o()^`.pLp^p`L.@ @ ^@ `.^`.L^`L.^`.^`.PLP^P`L.^`o() ^`hH. pLp^p`LhH. @ @ ^@ `hH. ^`hH. L^`LhH. ^`hH. ^`hH. PLP^P`LhH.&%7Kx                  %H-@+p@UnknownGTimes New Roman5Symbol3 Arial3Times"qh+Sf24m& .!24dE@?D0 Syntax QuizAdelphi Stephen Bloch    Oh+'0   0 < H T`hpx' Syntax QuizAdelphi Normal.dotmStephen Bloch3Microsoft Macintosh Word@e@a@ Id@4Tv. ՜.+,D՜.+,< hp  'AdelphiE  Syntax Quiz Title 8@ _PID_HLINKS'AL  hdiamond  !"#$%&'()*+-./012356789:;>Root Entry FyYv@Data 1Table&WordDocumentSummaryInformation(,DocumentSummaryInformation84CompObj` F Microsoft Word 97-2004 DocumentNB6WWord.Document.8