I noticed that MIT Scheme has the "pp" procedure which prints the source
code of a given function.  Is there an equivalent way to do this in Racket?

More generally, I'm looking to normalize nested procedures to their most
rudimentary expressions.

For example:

(define (something? x) (> x 3))
(define (something-else? x) (< x 10))
(define (combined x) (and (something? x) (something-else? x)))

(normalize combined) =>
'(lambda (x) (and (> x 3) (< x 10)))

((normalize combined) 7) => #t

I'm sure it's not so simple and a robust general solution involves some
type of beta reduction and/or argument constraints, but I'm just looking
for a nudge in the right direction.

Thanks.




-- 
Talk to you soon,

Scott Klarenbach

PointyHat Software Corp.
www.pointyhat.ca
p 604-568-4280
e sc...@pointyhat.ca
200-1575 W. Georgia
Vancouver, BC V6G2V3

_______________________________________
To iterate is human; to recur, divine
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to