Typed Racket: require macros from untyped modules

已查看 15 次
跳至第一个未读帖子

unlimitedscolobb

未读,
2021年1月3日 15:22:162021/1/3
收件人 Racket Users
Hello,

How can I require macros coming from untyped modules into typed modules?

Intuitively I'd expect that to be possible in a way or another because such imports don't seem to violate any safety guarantees, but maybe I'm missing something.

-
Sergiu

unlimitedscolobb

未读,
2021年1月3日 15:54:172021/1/3
收件人 Racket Users
I continued doing various tests and realized that my problem was something else, since the following code works:

#lang typed/racket

(module untyped-submodule racket
  (provide a macro)
  (define a 2)
  (define-syntax-rule (macro arg) (+ 1 arg)))

(require 'untyped-submodule)

(macro 3)

Using a in the enclosing module doesn't work (a is required without a type), but macro works fine.

Getting back to thinking and trying.

-
Sergiu
回复全部
回复作者
转发
0 个新帖子