<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 21, 2012, at 5:41 AM, Stephen Bloch wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 21, 2012, at 7:18 AM, Rodolfo Carvalho wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><div>BTW I just found the nested-cond pattern appearing on HtDP, throughout section 9:<br>
<a href="http://htdp.org/2003-09-26/Book/curriculum-Z-H-13.html">http://htdp.org/2003-09-26/Book/curriculum-Z-H-13.html</a><br></div></div></blockquote></div><br><div>That happens when you follow the HtDP design recipe directly and there are conditionals for two unrelated reasons, e.g. </div><div><br></div><div>(cond [(empty? L) ...]</div><div> [(cons? L)</div><div> (cond [(snark? (first L)) ...]</div><div> [(boojum? (first L)) ...]</div><div> [(beeblebrox? (first L)) ...]</div><div> )])</div><div><br></div><div>Yes, this COULD be collapsed into</div><div>(cond [(empty? L) ...]</div><div> [(snark? (first L)) ...]</div><div> [(boojum? (first L)) ...]</div><div> [(beeblebrox? (first L)) ...]</div><div>)</div><div>but that doesn't match the data structure as transparently.</div></div></blockquote><div><br></div>+1.</div><div><br></div><div>I tell my students to ollapse the cond *only* when it makes more sense in the collapsed form---it rarely does.</div><div><br></div><div>John Clements</div><div><br></div><div><br></div></body></html>