<div dir="ltr"><div><div><div>Right now Medic doesn't support directly running "med.rkt" to get the results (has to know the set of medic programs to execute and which source file to start debugging). We need to write another program to debug the source code. The program should be in the same directory of medic programs:<br><br></div>#lang racket<br><br></div>(require medic/core)<br><br></div>(medic "/tmp/med.rkt")<br>(debug "/tmp/src.rkt")<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 26, 2015 at 11:42 AM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@cs.indiana.edu" target="_blank">samth@cs.indiana.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Xiangqui, <br><br>I just tried to run this, but it didn't show anything.<br><br></div>I put this in /tmp/src.rkt:<br><br>#lang racket<span class=""><br> (for/fold ([v 0]) ([x (in-range 100)])<br></span><span class=""> (+ v (/ x 100)))<br><br> (for/fold ([v 0]) ([x (in-range 100)])<br></span><span class=""> (+ v (/ x (- 100 x))))<br><br></span></div>and this in /tmp/med.rkt:<br><br>#lang medic<br><br>(layer layer1<br> (in #:module (file "/tmp/src.rkt")<span class=""><br> [(at (+ v (/ x 100))) [on-entry (timeline v)]]<br> [(at (+ v (/ x (- 100 x)))) [on-entry (timeline v)]]))<br><br></span></div>And then tried running "med.rkt" either in DrRacket or at the command line. It doesn't print anything that I can see. Do I need to do something else?<br><br></div>I have the latest version of medic installed, I think.<br><br>Sam<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jan 26, 2015 at 1:22 PM, Xiangqi Li <span dir="ltr"><<a href="mailto:artlessu@gmail.com" target="_blank">artlessu@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>For the testing program provided by Matthew, we can also use <b>(timeline v)</b> (an enhanced version of displayln) to compare the value of v at each iteration and see the results in a better way: <br></div><div><br><img style="margin-right:0px"><br></div><div>If you want to try it out yourself, you can go to <a href="https://github.com/lixiangqi/medic" target="_blank">https://github.com/lixiangqi/medic</a> and install the Medic package which has support for timeline. By writing the following Medic program, <br><br>#lang medic<br><br>(layer layer1<br> (in #:module "src.rkt"<br> [(at (+ v (/ x 100))) [on-entry (timeline v)]]<br> [(at (+ v (/ x (- 100 x)))) [on-entry (timeline v)]]))<br><br></div><div>you'll see a timeline view of results. <br></div><span><font color="#888888"><div><br></div>Xiangqi <br></font></span><span><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 24, 2015 at 09:56 AM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Jens Axel and Alexander have provided the answer, but in case it helps<br>
to see what they mean, try these loops that display the intermediate<br>
results:<br>
<br>
(for/fold ([v 0]) ([x (in-range 100)])<br>
(displayln v)<br>
(+ v (/ x 100)))<br>
<br>
(for/fold ([v 0]) ([x (in-range 100)])<br>
(displayln v)<br>
(+ v (/ x (- 100 x))))<br>
<br>
</blockquote></div><br></div></div></div></span></div>
<br></div></div>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>