You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#lang racket
(module first racket
(struct foo (x))
(provide (struct-out foo)))
(module second racket
(require (only-in (submod ".." first) foo))
(provide (struct-out foo)))
(require 'second)
foo-x
;; struct-out: no binding for structure-type identifier
;; at: struct:foo
;; in: (struct-out foo)
It's unclear which one has the desired behavior. Note that struct-out used to have the same behavior as contract-out, but it was changed to the current behavior in 096ec54
The text was updated successfully, but these errors were encountered:
A note on the difference: A provide can only export bindings that are imported or defined. In the case of struct-out, if it did not complain about struct:foo, then provide would complain. In the case of contract-out, new bindings are created in the providing module by contract-out (to implement the contract), and those bindings can refer to things (via macro expansion) that are not explicitly imported. So, that's why contract-out can export more — because it's really exporting different.
evaluates to the accessor
foo-x
.However, the corresponding
struct-out
fails:It's unclear which one has the desired behavior. Note that
struct-out
used to have the same behavior ascontract-out
, but it was changed to the current behavior in 096ec54The text was updated successfully, but these errors were encountered: