[racket] Saving function bodies in Beginning Student Language

From: Gregory Marton (gremio at acm.org)
Date: Mon Jun 27 14:40:12 EDT 2011

> What you see here is the BSL printer of course. It insists on showing 
> students the list in terms of basic construction steps.

Thanks,

> As Eli said, in BSL, a function definition defines a macro. So your define/source needs to deliver a macro that obeys the same protocol (I am not sure that's doable via a teachpack).

To both of you, thanks.  That's good to know, and now I think I get why 
things aren't working, if not yet how to play nice.


> May I ask how you wish to explain the evaluation of expressions? Or how 
> your presentation is going to differ from the stepper's?

This is for one particular function, onscreen?, which says when their 
characters are on (or near) the screen, so the function they're writing 
will end up as something like:
   (define (onscreen? x) (and (< -100 x) (< x 740)))

The presentation I'm writing puts their characters on the screen, lets them 
move those characters around, and in real time shows the way each 
s-expression gets evaluated.   So  (< -100 x)  -->  (< -100 -90) --> True
and then they hit left-arrow twice and get
    (< -100 x)  -->  (< -100 -110) --> False
instead, or whatever sub-expressions their current code actually has.
So there is no stepping -- all (or most) steps are presented at once.

This is also important because, at the moment, WeScheme doesn't have a 
stepper, and DrRacket's stepper has a (reported) bug about relative 
teachpack paths, so using the stepper has been challenging.

More generally, I think facilities like procedure-source would be useful to 
others writing pedagogical software with the beginning student language or 
other student languages.

As for how to explain evaluation, I've tried to follow the Bootstrap notes 
pretty closely, teaching evaluation in terms of substitution.
    http://www.bootstrapworld.org/materials

Thanks,
Grem

-- 
------ __@   Gregory A. Marton                 http://csail.mit.edu/~gremio
--- _`\<,_                                                     617-858-0775
-- (*)/ (*)               Will build language models for food.
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~



Posted on the users mailing list.