<div dir="ltr">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?<div><br></div><div>More generally, I'm looking to normalize nested procedures to their most rudimentary expressions.</div>
<div><br></div><div>For example:</div><div><br></div><div>(define (something? x) (> x 3))</div><div>(define (something-else? x) (< x 10))</div><div>(define (combined x) (and (something? x) (something-else? x)))</div>
<div><br></div><div>(normalize combined) =></div><div>'(lambda (x) (and (> x 3) (< x 10)))</div><div><br></div><div>((normalize combined) 7) => #t</div><div><br></div><div>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.</div>
<div><br></div><div>Thanks.</div><div><br></div><div><br></div><div> <br clear="all"><div><br></div>-- <br>Talk to you soon,<br><br>Scott Klarenbach<br><br>PointyHat Software Corp.<br><a href="http://www.pointyhat.ca" target="_blank">www.pointyhat.ca</a><br>
p 604-568-4280<br>e <a href="mailto:scott@pointyhat.ca" target="_blank">scott@pointyhat.ca</a><br><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">200-1575 W. Georgia</span><br>
Vancouver, BC <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">V6G2V3</span><br><br>_______________________________________<br>To iterate is human; to recur, divine
</div></div>