Good stuff to know. Thx.<br><br><div class="gmail_quote">On Sun, Aug 21, 2011 at 6:06 PM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">6 hours ago, Ray Racine wrote:<br>
><br>
</div><div class="im">> Fire up my repl with the path to my personal collection and invoke.<br>
> [ray@ray rktlib]$ rlwrap /usr/local/racket/bin/racket -i -S /code/rktlib<br>
<br>
</div>If you're working on a shell it would be better to use readline -- but<br>
since you're using the git head, it's even better to use the new<br>
`xrepl'. Just add (require xrepl) to your ~/.racketrc, and you'll get<br>
readline and an additional bunch of tools for REPL-use.<br>
<div class="im"><br>
<br>
> In the old days it seemed I generally got an accurate error line and<br>
> stack trace. In the above error, I'm pretty sure the error is<br>
> occurring in the "worker" for-each which is not lexically near line<br>
> 194. The context information is less than helpful in the sense that<br>
> misc.rkt:87 is the repl's invoke and then the next thing I'm given<br>
> is the for-loop error. All in all a rather thin context to work<br>
> with.<br>
<br>
</div>The stack information that you see is imprecise in the sense that<br>
Matthew mentioned, and indeed errortrace compiles code with explicit<br>
annotations so that you get precise information. (But that comes at a<br>
runtime overhead.) With DrRacket, you get the extra errortrace<br>
information when you have the debugging option on.<br>
<div class="im"><br>
<br>
> I've tried to ask racket to provide a full stack trace with things<br>
> like adding '-l errortrace' when invoking racket, but to no avail.<br>
> So next question, how do I compel racket to provide the full call<br>
> stack on errors?<br>
<br>
</div>When you add that flag you do get errortrace, but then it's tricky to<br>
get the rest.<br>
<br>
racket -l errortrace<br>
<br>
you get no REPL -- need to add a -i flag:<br>
<br>
racket -l errortrace -i<br>
<br>
you get a REPL, but it has no useful binding -- you're missing the<br>
language, so add `racket/init' too<br>
<br>
racket -l errortrace -l racket/init -i<br>
<br>
which finally works. Alternative shorter syntax for that:<br>
<br>
racket -lli errortrace racket/init<br>
<br>
And if you're using `xrepl', you get a command that turns on<br>
errortrace: ",errt".<br>
<br>
(But as Matthew said, all of this depends on compiling code in an<br>
"errortrace mode" so if you precompile your files, you don't get the<br>
extra information.)<br>
<div><div></div><div class="h5"><br>
--<br>
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br>
<a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a> Maze is Life!<br>
</div></div></blockquote></div><br>