Typed racket require module repeated evaluation

こ雲淡風輕ζ 提交于 2021-01-05 07:22:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!