<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 5, 2012, at 4:53 PM, Rüdiger Asche wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="font-family: 'Lucida Grande'; font-size: medium; "><font size="2" face="Arial">But nevertheless, what about macro expansion time? </font></div></span></blockquote><div><br></div><div>Yes, you will pay for this trick at compile time. But presumably, you will compile your program once and run it 1,000 times or you don't care whether it takes 2s or 4s wall time. </div><div><br></div><blockquote type="cite"><font size="2" face="Arial"> the student is already so familiar with the syntactic expansion mechanism that he or she "looks behind the macro" at first glance and is able to identify both as based on the same procedure and only takes the macro approach for better readability - or does it mean that match is being looked at as some kind of black box that has a semantic of its own (regardless of how it is being implemented under the hood)?</font></blockquote><div><br></div><div>I don't know about Ashley's instructor. If I assigned such a problem, I would expect students to solve it with the small language that they have learned so far (see teaching languages for HtDP), which is unlikely to include match. I would definitely not use Racket as the first language to introduce FP or such things. </div><div><br></div><div>If I were to introduce match, it would be done so as an abstraction over the selection process. When would I address the resource consumption time? Honestly, I find the distinction between match and cadr-chains to be too small to matter. I would probably never mention it. There are too many other things to worry about. </div><div><br></div><div><br></div><div><blockquote type="cite"><font size="2" face="Arial">Regardless, for the sake of the excercise, it's kind of enlightening that your solution actually reduces to the naive approach - when I was in school (before the last ice age if I recall correctly)</font> <font size="2" face="Arial">,</font></blockquote><br></div><div>There can't have been an iceage. The earth has been warming up for forever :-) </div><br><blockquote type="cite"><span class="Apple-style-span" style="font-family: Arial; font-size: small; ">Sorry for side tracking, I just try to understand how an excercise like that is set up and what a "good" solution is expected to look like and why...</span></blockquote><div><br></div><div>Good way to keep from doing real work. </div><div><br></div><br><blockquote type="cite"><span class="Apple-style-span" style="font-family: Arial; font-size: small; ">btw, if this response should look funny in the thread tree view it's because Matthias signed his message digitally, and my Outlook wouldn't allow me to respond all without signing my response (which somehow didn't work), so I had to revert to a response on an earlier mail of mine, sorry.</span></blockquote><br></div><div>Apologies for that. I had no intention to sign anything ... </div><div><br></div><div>-- Matthias</div><div><br></div><br></body></html>