[plt-scheme] complile-file and debugging

From: Robby Findler (robby at cs.uchicago.edu)
Date: Mon Apr 9 17:42:56 EDT 2007

On 4/8/07, jos koot <jos.koot at telefonica.net> wrote:
>
>
> Hi,
> This applies to DrScheme, version 369.8-svn5apr2007 [3m].
>
> Can I trust that the standard current-eval and procedure compile-file do not
> include debugging code when debugging is disabled in the choose-language
> dialog? Is the debug option propagated when code being evaluated or compiled
> involves other applications of the standard current-eval and procedure
> compile-file? I looked into the docs, but found no explicit info on this
> matter.

Turning on debugging means that anything passing thru the current-eval
handler gets the errortrace annotations, unless that thing is already
compiled code (which is what you'd get when requiring a pre-compiled
.zo file).

Note that sometimes the .zo files already have errortrace annotations
compiled in, if they were created with them (say, with, setup-plt
--mode errortrace, for example).

> I found that when using language mzscheme without debugging, opening a file
> starting with (module ... sets the language for that file to (module ...)
> with the debug option enabled. Therefore I wonder what compile-file does
> when called from mzscheme without debugging for a file containing a module.

That "cleverness" you're seeing is drscheme looking at the beginning
of the file and setting the language level based on it. Nothing else.

> In short, how can I make sure that either all code is debugged or none of
> the code is debugged?

That's a different issue; I guess I'd need more context to answer that
one.  One piece of the answer; if you throw away all .zo files, then
the setting in the language level will determine how all files behave
(and when I say "all" I mean really everything: planet, the ones in
drscheme ,etc).

But I don't think you really want to be doing that. We've tried to
design things so that mixing code with debugging annotations and code
without should work reasonably well.

Robby


Posted on the users mailing list.