<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 2, 2013, at 5:07 AM, Michael Situ wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>I think I found a typo in the example from section 17.8 and wanted to bring it to the authors' attention:<br><br>(define (web=? a-wp another-wp)<br> (cond<br> [(empty? a-wp) (empty? another-wp)]<br> [(symbol? (first a-wp))<br>
(and (and (cons? another-wp) (symbol? (first another-wp)))<br> (and (symbol=? (first a-wp) (first another-wp))<br> (web=? (rest a-wp) (rest another-wp))))]<br> [else<br>
(and (and (cons? another-wp) (<b>list?</b> (first another-wp)))<br> (and (web=? (first a-wp) (first another-wp))<br> (web=? (rest a-wp) (rest another-wp))))]))<br><br>should the <b>list?</b> function call be <b>cons?</b> instead?<br></blockquote></div><div><br></div><div><br></div><div>When evaluation reaches the third case, we know that</div><div><br></div><div> a-wp is (cons ewp a-wp0)</div><div><br></div><div>The only way that another-wp is possibly equal to a-wp means</div><div><br></div><div> (1) another-wp must have the shape (cons e-another-wp another-wp0)</div><div> (2) which means that e-another-wp must belong to "Web page"</div><div><br></div><div>To ensure condition 2 e-another-wp (as much as needed at this point), </div><div><br></div><div> e-another-wp must be one of (a) empty (b) (cons some-symbol web-page) (c) (cons embedded-web-page web-page)</div><div><br></div><div>At a min, it must be either empty or cons. That means it must be list? not just cons? . </div><div><br></div><div>Makes sense? -- Matthias</div><div><br></div></body></html>