racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
447 stars 95 forks source link

phase X (X > 0) is executed more than once #278

Open sorawee opened 5 years ago

sorawee commented 5 years ago

(Copied from https://github.com/greghendershott/racket-mode/issues/379)

#lang racket

(begin-for-syntax
  (println 1))

results in

1
1
1

in DrRacket. However, if we run this in racket, only one 1 appears.

rfindler commented 5 years ago

This is because of the way DrRacket implements debugging, and is expected. You can see a similar thing at the command-line if you use errortrace (which is the library that DrRacket uses to do debugging). Ie, put that code in x.rkt and run like this

$  racket -l errortrace -t x.rkt
1
1
samth commented 5 years ago

There's one from the regular execution, and one from errortrace, but DrRacket produces a third one (or a second one if errortrace is off). What's that from?

rfindler commented 5 years ago

It probably compiles the content? I'm not sure