<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>&nbsp;&nbsp; (cond<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [(empty? a-wp) (empty? another-wp)]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [(symbol? (first a-wp))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (and (and (cons? another-wp) (symbol? (first another-wp)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (and (symbol=? (first a-wp) (first another-wp))<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (web=? (rest a-wp) (rest another-wp))))]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (and (and (cons? another-wp) (<b>list?</b> (first another-wp)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (and (web=? (first a-wp) (first another-wp))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (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&nbsp;that</div><div><br></div><div>&nbsp; &nbsp;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>&nbsp;(1) another-wp must have the shape (cons e-another-wp another-wp0)</div><div>&nbsp;(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),&nbsp;</div><div><br></div><div>&nbsp;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? .&nbsp;</div><div><br></div><div>Makes sense? -- Matthias</div><div><br></div></body></html>