On Thursday evening, we have what I call a "technology" session, aka, Scheme in the Real World. Note that teachers tend to think of "technology" as synonymous with "cool hardware gadgets", so this session neds a better name. PURPOSE: To make clear that Scheme is an excellent language for building real applications, and the PLT Scheme suite is especially handy for this purpose. Wow 'em. BACKGROUND: All week long, I promised that I'd show them how to build a gradebook. This seems to strike a chord, because it appears they have no reasonable grade management software. I'd be happy to take other suggestions, but this sounds like a winner for now. Order of Topics --------------- I first explained that we were going to use lists extensively and introduced QUOTE. As I got into nested lists in QUOTE syntax, my examples began to look more and more like a little gradebook. The attentive ones began to see where this was going. Next I demonstrated READ. All along, I kept insisting that they be able to transition between CONS, LIST and QUOTE syntaxes. I briefly touched upon, but glossed over, the fact that a quoting something that looks like a number yields a number, not a symbol. I snuck strings into the mix. I presented WITH-INPUT-FROM-FILE, which works out remarkably well in this context: (with-input-from-file "filename" read) This generates a list of lists. Using the recipes, they can turn this into a list of structures, which I did. Now they're back in a very familiar realm. I made them realize they could write lots of simple procedures over this database. All this leaves is output. This is more messy: (delete-file "filename") (with-output-to-file "filename" (lambda () (write ...))) I glossed over the LAMBDA without explaining it. By this time, they were happy enough to see that all they had learned so far was going to be very useful in building up gradebook functions. Following this, Paul demonstrated MysterX and MzCOM. We followed this schedule due to hardware setup reasons; this demo can happen just as well at another time. Indeed, with a fancy enough demo, perhaps it's best to put this off until 3/4 of the time into the session (before people have begun to leave). I threw in an interlude about bignums (since not everyone had necessarily realized they were there). Note that the AP's primary case study until this year was on BigInts. I briefly discussed how I employed these to compute pi to 100,000 digits. Next I discussed Web applications. Primarily, I showed that the CGI package turns string URLs into structures. The Help Desk documentation on this looks similar enough to what they write in class that they can actually follow it along for a while. As a demonstration, I opened a Web page and read a line. I chose the Rice CS home page; the entire file is a single line, producing an extremely large output. This inspired a digression into CIAC advisories and the perils of fixed-buffer-size programming. The next major theme was HTML. I wrote a small HTML document on the board, then used colors to transform it into parenthesized form. (I ignored attributes; since I didn't demonstrate the actual XML library, they didn't notice this absence.) I used this to explain XML and how it fit very smoothly into Scheme's philosophy. The teachers who cover topics like Web mastering were beginning to pay real close attention. I asked them, then, what Web templates really are. Well, they're functions; so we'd like to use Scheme functions and QUOTE. Problem is, QUOTE doesn't know about variables. So I introduced QUASIQUOTE and UNQUOTE (but ignored UNQUOTE-SPLICING). With this, I was able to build up a reasonable site template. I also demonstrated how this can simplify the construction of tables (with their myriad tags). At this point, I don't think there was any doubt left as to the practical possibilities. Kathi and I made repeated mentions of the actual applications we had written. They had seen enough, and were convinced, even dazzled; any more would have been sheer overload. If enough people attend this session, note that it makes for a great collection of examples for lectures on higher-order programming. I had to resist every temptation to teach MAP/FILTER/FOLD here instead of on Friday afternoon. I did anyway refer to these examples on Friday afternoon, for the benefit of those who did attend. Some topics people were interested in, but we didn't cover: - CGI - scripts (ie, a lightweight environment) - graphics - databases