In JavaScript, I can retrieve the "source code" definition of a function, for example:
function alert_Hi() {
alert("Hi");
}
alert(alert_Hi);
will return exactly what I typed. http://jsfiddle.net/DuCqJ/
How can I do this in MIT Scheme?
I remember seeing something that returns #compound-procedure
or something, but what I really want is the "source code".
You might try pp
(define (display-hi) (display "Hi"))
(pp display-hi) =>
(named-lambda (display-hi)
(display "Hi"))