问题
This is a follow-on to this answer to this question.
When this code is saved to a file and run from the command line, it prints 13 three times. Twice I can understand, but three times? Why?
When I run it from racket-mode in emacs it prints 13 five times!
And when I run it in DrRacket it prints 13 seven times!
The behaviour is also different in vanilla Racket? Changing #lang typed/racket
to #lang racket
prints 13 once from the command line, twice from emacs and three times from DrRacket.
What's going on here?
#lang typed/racket
(module for-syntax-mod typed/racket
(provide foo)
(: foo (-> Real Real))
(define (foo n)
(+ n 3)))
(require (for-syntax 'for-syntax-mod))
(begin-for-syntax (println (foo 10)))
来源:https://stackoverflow.com/questions/65447945/typed-racket-require-module-repeated-evaluation