Re: [racket] Saving function bodies in Beginning Student Language

2011-06-27 Thread Gregory Marton
On Jun 27, 2011, at 2:40 PM, Gregory Marton wrote: 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. I haven't seen this bug report but that's

Re: [racket] Saving function bodies in Beginning Student Language

2011-06-27 Thread Matthias Felleisen
On Jun 27, 2011, at 2:40 PM, Gregory Marton wrote: > 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. I haven't seen this bug report but tha

Re: [racket] Saving function bodies in Beginning Student Language

2011-06-27 Thread Gregory Marton
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

Re: [racket] Saving function bodies in Beginning Student Language

2011-06-27 Thread Matthias Felleisen
On Jun 26, 2011, at 11:01 PM, Gregory Marton wrote: > In BSL: > >> (define/save-source (foo x) (+ x 3)) >> (procedure-source foo) > (cons '? (cons (cons 'x empty) (cons (cons '+ (cons 'x (cons 3 empty))) > empty))) What you see here is the BSL printer of course. It insists on showing student

Re: [racket] Saving function bodies in Beginning Student Language

2011-06-27 Thread Eli Barzilay
Not really an answer -- but note that in BSL functions are actually defined as macros, so it's not surprising that your macro fails. (But probably possible to get it to work somehow.) Four hours ago, Gregory Marton wrote: > > So my question boils down to: > 1. Is there a way that I can use the

[racket] Saving function bodies in Beginning Student Language

2011-06-26 Thread Gregory Marton
Hi folks, In trying to improve the Bootstrap[1] teachpacks, I've written (with help[2]) a macro to save function bodies in a hashtable in the sky before actually defining them. That way, I can programmatically break down a function definition into its constituent pieces and show how they're