[plt-scheme] complile-file and debugging

From: jos koot (jos.koot at telefonica.net)
Date: Tue Apr 10 06:01:14 EDT 2007

Thanks. What I do is:
1: Enter DrScheme with an scm file that deletes my own zo files and compiles my ss files.
2: Disable debuging and press the run button.
3: Open a program I want to run, select the right language, turn debugging off if necessary and press the run button. In this program and my own zo files my own modules are required with
(require (lib "compiled/file.zo" "my own collection")).
5: Occasionally my code may use (load "some-non-module-file.scm") for files that have no zo counterpart.

If I understand your answer correctly I may trust that my own zo files have no debugging annotations, although other modules not written/compiled by myself may still have debugging annotations. That's alright for me. That's exactly what I want. I also understand that my non-module scm files will be evaluated without debugging. Perfect.

One more remark about DrScheme's "cleverness" looking at the beginning
of a file being opened and setting the language level based on it:

File one.ss:
(module one mzscheme)
Selects language module, alright, very nice indeed, although it would even be nicer if the debugging and other detail option settings would not be affected (as far as possible, for different languages may have different sets of detail options)

File one+two.scm:
(module one mzscheme)
(module two mzscheme (require module one)) 
(require two)
Selects language module too, which is not right. Correcting this would require DrScheme to look somewhat further than the beginning of the file. Perhaps you dont want to do that because it may significantly slow down opening the file.

Thanks again, Jos Koot

(((((lambda(x)((((((((x x)x)x)x)x)x)x)x))
    (lambda(x)(lambda(y)(x(x y)))))
   (lambda(x)(x)x))
  (lambda()(printf "Greetings, Jos~n"))))
  ----- Original Message ----- 
  From: Robby Findler 
  To: jos koot 
  Cc: PLT-list 
  Sent: Monday, April 09, 2007 11:42 PM
  Subject: Re: [plt-scheme] complile-file and debugging


  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070410/fb0a6f97/attachment.html>

Posted on the users mailing list.