<div dir="ltr">You say "wrap" but in your example you replace the call of function b with another function. <div><br></div><div>Without a specific use-case I'm not sure about the use of speculating on your meaning.<br><br>Would you be satisfied with</div><div>(search&wrap function-b <br></div><div>   (define (function-a ...) ...))</div><div>or</div><div>(define (function-a ...)</div><div>   (with-function-wrapper ([function-b ...]) ...))</div><div>?</div><div><br></div><div>Otherwise it seems like you are asking for something that precludes separate compilation and has effects that cross module boundaries... sounds unpleasant if not terrible.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Andrew Mauer-Oats<br>Mathematics Ph.D.<br>Chicago Public Schools: Whitney Young<br></div></div>
<br><div class="gmail_quote">On Tue, Feb 24, 2015 at 6:52 AM, Jukka Tuominen <span dir="ltr"><<a href="mailto:jukka.tuominen@finndesign.fi" target="_blank">jukka.tuominen@finndesign.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
This is something I've been wondering for years and always ended up doing<br>
it manually. So, why not ask it out loud...<br>
<br>
I wonder whether it would be possible to search and wrap all definitions<br>
that reside outside a specified function, other than those contained in<br>
#lang racket?<br>
<br>
Say, (search&wrap 'function-a)  would start in the situation like<br>
<br>
(define (function-a x y z)<br>
   (function-b x y z))<br>
<br>
It would then search the definition for 'function-b and would output<br>
something like<br>
<br>
(define (function-a x y z)<br>
   (define function-b +)<br>
   (function-b x y z))<br>
<br>
It does not have to search through unintroduced library files (though it<br>
would be even cooler), only starting in a situation where all the needed<br>
definitions can be found within the same level or 'required' from other<br>
files.<br>
<br>
It should also work recursively, so that eventually no library calls would<br>
be needed to run the function-a.<br>
<br>
Any idea whether this is feasible?<br>
<br>
br, jukka<br>
<br>
<br>
<br>
____________________<br>
  Racket Users list:<br>
  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div>