Aald HH $ @d HHHHff@  d Footnote TableFootnote**.\t.\t/ - :;,.!?6 `+  `TOCHeading1Heading2   EquationVariables^eg@e @f  a q b a 4 ) I > )<$lastpagenum> *<$monthname> <$daynum>, <$year> +"<$monthnum>/<$daynum>/<$shortyear> ,;<$monthname> <$daynum>, <$year> <$hour>:<$minute00> <$ampm>= -"<$monthnum>/<$daynum>/<$shortyear> .<$monthname> <$daynum>, <$year>i 5 /"<$monthnum>/<$daynum>/<$shortyear> 0 <$fullfilename> 1 <$filename>@ 2 <$paratext[Title]> 3 <$paratext[Heading1]>H 4 <$curpagenum> 5 <$marker1> 6 <$marker2> 7 (Continued) 8+ (Sheet <$tblsheetnum> of <$tblsheetcount>)d 9Heading & Page <$paratext> on page<$pagenum> :Pagepage<$pagenum> ;See Heading & Page%See <$paratext> on page<$pagenum>.` < Table All7Table<$paranumonly>, <$paratext>, on page<$pagenum> =Table Number & Page 'Table<$paranumonly> on page<$pagenum>  FFA HHA JJ NN PP RrA  Fwmo5y  va<$5|  v;5  u>nu] j j >:5 ! u >=5 " t"hn^b # { vmor] $ j jmo] % jd, ^: & { v"] ' j j/um^c ( v va ^< )  vi1.^= *  i2.^> +  a3.t^? , q -^@ - q q]-^A .  qg4.5^B /  r5.^C 0 q -^D 1 q q)-^E 2 q q -^F 3 q q$-^G 4  qd6.d] 5 j j<ex^ 6 j jnu^ 7 j jage^ 8 { v^ 9 v vnge^ : b vr^ ; b ba^ < q ba-^ = b ba^ > j jt o^ ? j jg^ @ j j &^H A q l-^I B q q -^ C b q^d D v^ E v vA^e S j j^f T j j^g U j jJ^h V j j^i W j jN^j X j j^k Y j j^l Z v j^m [ v vmo^n \ ja<$^o ] j j;^p ^ j j>nu^q _ j j >:^r ` j j >=^s a j j"hn^t b j jmor^u c j jmo^v d j jd, ^w e j j"^x f j j/um^y g j ja \ { { ji1.\ | j j\ y y>a\ j y q\ j y q\ j v \ j v.^B\ j v\ j jZ, y j)] j j \ j j$] j jd6.] j jj] j jj] j jj] j j{] j jv] j jb] j jb] j jq] v vb] { yjZ { vjZ v vj\  j jq]  j jq]  j jb] # j j] $ j jv] ) j jj] + y yj] - j yj], 8 j vj]- 9 jj]< ; jj]5 = j jj]R > j jv]= ? jv]> @ j j]A A j jj]C C jj]D D j jj]E E j jj]F F j jj]V I j jj]W J j jj]X K j jj]Y L jj]Z M j jj][ N j jj]\ O j j{]a R j jj]b S j jy]c T j jj]d U j jj]m X j vj5 K+\dq5jPF]dq6jdJH]dq7j{8C]Hm3R q897 jqHm3R H RH R FootnoteHr@ q98:7 jHr@ HzHz  Single LineH'q:9<7 j;;Footnote j  5_;:j     HD q<:=7 ]>HD HH  Double LineH q=<@7]F>?j Double LineJ j5c>?=j5e?>=]b]c jH q@=B7AA Single Line5hA@HZqB@C7q TableFootnoteEGxR qCB7 9EGxR EPwEPw  TableFootnoteod@DRRHH5xE5 HH F e   HH5zFN5 HHlEE DHH5{G6 HH@>?HDo d   HH5}HJ6HHlGG HUV 5~I6 HUV AAJUUh  f6e HUV 5JH6HUV lII qHUV 5M5 HUV GxRNUUe !  HUV 5NPF5HUV lMM H$ 5O5 H$ e PUUe "  H$ 5PN5H$ lOO HH@QD HH]d R ` & Environment Model +  ) 8To evaluate a combination: evaluate subexpressions then 5~A  ) ?apply  value of operator subexpression to values of operand W @ ) ٪subexpressions. w  * @Value of a variable w.r.t. an environment is the value given by   * >the binding of the variable in the first frame in the environ @ * #ment that contains such a binding. ` + 1A lambda expression produces a procedure object: F  , )  w.r.t. an environment E: + ` A A Evaluate    w.r.t. E duA  B CFind and change the nearest binding for    in E to hold thW @ B ,value of    ed HH@RDnroHHlVQQ  dYTlteVVDeneHHYUT HH bject toVme ` # Use and Mis-Use of Set! ) ` ( Ha t counter n) UL UT` V rg product UJ UT` W t" (iter (* counter product) UH UT` X  (+ counter 1)))) UF UT` Y To (iter 1 1)) ` Z  r ` [ E UD UT` \ A .;; Imperative programming style -- DEPRECATED %UB UT` ] c(define (factorial n) :U@ UT` ^   (let ((product 1) OU> UT` _ e  (counter 1)) dU< UT` ` @ (define (iter) royU: UT` a  (if (> counter n) U8 UT` b  product U6 UT` c l4 (begin (set! product (* counter product)) U4 UT` d . (set! counter (+ counter 1)) U2 UT` e  (iter)))) U0 UT` f (iter))) U. UT` g Ha tHHYVTmg HHlRbUU d^/`aUNbb(>ouHH^0a` cHHA roduct) b X ` nt 1) ` ٪ Y counter n) @UH UT` r) product UF UT` c. (begin (set! counter (+ counter 1)) UD UT` c4 (set! product (* counter product)) t)UB UT` d (iter)))) couU@ UT` ) (iter))) e% `  (; ` UT HH^2b` tHHlVgaa d^eggHH^fe >ouHH^0  HHg ` 8 duImplications of Mutation ) ` 9 nt 1J  : ٪JMust worry about  time  and  change : order of evaluation mat` @ : inters! ` ; ٪%Variables no longer stand for values T ` < (Become places whose contents may change (d ` = UJAMust worry about  identity : lose referential transparency ` C UF4Natural for modeling objects/systems with  state un ` E ٪ HH^genr HHlbjff coud^hjj UTHH^ih HHVgj ` $Message-Passing Ship Implementation &UT UT`  ;UR UT` *(define (make-ship x-pos y-pos time-left) PUP UT`  (define (move dx dy) eUN UT` du (set! x-pos (+ x-pos dx)) zUL UT` 1 (set! y-pos (+ y-pos dy)) UJ UT`   (list x-pos y-pos)) ofUH UT`  (define (count-down) UF UT`  Va% (set! time-left (- time-left 1)) UD UT` > Be (if (<= time-left 0) mUB UT` ?  blast-off rryU@ UT` @ y time-left)) tr U> UT`   (define (dispatch message) i"U< UT`  w% (cond ((eq? message move) move) 7U: UT` # 1 ((eq? message count-down) count-down) LU8 UT` $ / (else (error "No method" message)))) aU6 UT` ) dispatch) x `  U4 UT` - ,(define enterprise (make-spaceship 0 0 10)) U2 UT` 6  gU0 UT` 7 #((enterprise move) 1 2) ==> (1 2) sin ` + io HH^jh(dHHlgrii  d^pu rr) ULHH^qp d) HHv UH UTr  ` { UF"Data-Directed Ship Implementation &UT UT` |  D;UR UT` 8 (define (install-ship-package) PUP UT` 9 b ;; Internal representation eUN UT` @ t)0 (define (make-ship x y time) (list x y time)) agzUL UT` ;  ; Accessors UJ UT` e)$ (define (ship-x ship) (car ship)) UH UT` A nt% (define (ship-y ship) (cadr ship)) UF UT` C (e ; Mutators "UD UT` $ U6# (define (set-ship-x! ship new-x) UB UT` D  (set-car! ship new-x)) erpU@ UT` E ip# (define (set-ship-y! ship new-y) U0 U> UT` F ((! (set-car! (cdr ship) new-y)) n"U< UT` ? io ; Operations 7U: UT` =  (define (move ship dx dy) LU8 UT` > ' (set-ship-x! (+ (ship-x ship) dx)) aU6 UT` I ' (set-ship-y! (+ (ship-y ship) dy)) HvU4 UT` J ^( (list (ship-x ship) (ship-y ship))) U2 UT` K  U0 UT` L - ;; External representation - tagged object cU. UT` M at- (define (tag x) (attach-tag spaceship x)) U, UT` ' -s (put make spaceship U* UT` 5 er. (lambda (x y t) (tag (make-ship x y t)))) U( UT` N t (put move spaceship L U& UT` O - (lambda (s dx dy) (tag (move s dx dy)))) iU$ UT` R p) done UT3U" UT` S ef ) hiHU UT` T ip ]U UT` U (e(define (move obj dx dy) rU UTd X e " (apply-generic move obj dx dy) HH^rpU@HHljqq  UT d5hiLeft nd6OpRightd7ef ReferencepdD(sdT) d`(sp-deUTdhhiipdpUT a k' f a CellTiny.  f b U& OBullet1 \t . agf cCellBody. f d  CellHeading. f e  Footnote. Tf fTHeading1Body. f gT Heading2Body. f hT  HeadingRunInBody. f i l yIndented. f j  Scheme. f l o o TableFootnote. f mT  TableTitleT:Table : .  f nPTitleBody. f o T  TableTitleT:Table : . f p   CellHeading. $f q $. Bullet2-\t. f r   CellFooting. f s  SchemeSig . @ t  oHeader. @ u  +> Footer. f v Body. f w Scheme. f y Scheme. f zESi. Numbered1.\tNumbered. f { THeading1Body.  f | tBulleted\t. f }T Heading1ContBody.  f  . Numbered.\t. f Body. f  Scheme. f CellBody. f Equation. f . Numbered.\ty. f  HighlightNumberr.  f . Numbered.\t. f CellTiny. $f $.  Bullet2-\tf.  f  Bullet1\t. +33f +33. SubNumbered < >.\t.   Emphasis EquationVariables         SchemeFont         SchemeFont  u3f  Thin  SuMedium tDouble Thick@ mph Very Thin-=-     oH p rH p rH p rH p rH p rFormat A   ou v b vu v v vu v a veu v v vFormat Beue U e V UComment @ afe d BlackT!WhiteddARedhedd Greendd   Blued Cyand Magentad Yellow  M.Times.P Times-RomanM.Arial Rounded MT Bold.B M.Times.B Times-Bold M.Courier.B Courier-Bold M.Courier.BICourier-BoldObliqueh M.Helvetica.B-Helvetica-BoldArial Rounded Monotype Bold Courier HelveticaTimesRegularRomanrBoldedBold RegularObliqueItalicl^5$DPUW'62^111}WTgxCUE3%It;~EÇTBZqoM}Я7l[04N `a