[racket] Question

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Sep 5 17:01:54 EDT 2012

On Sep 5, 2012, at 4:53 PM, Rüdiger Asche wrote:

> But nevertheless, what about macro expansion time? 

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. 

> 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)?

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. 

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. 

> 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) ,

There can't have been an iceage. The earth has been warming up for forever :-) 

> 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...

Good way to keep from doing real work. 

> 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.

Apologies for that. I had no intention to sign anything ... 

-- Matthias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120905/d5f88f22/attachment.html>

Posted on the users mailing list.