Rename 'open' to 'include', then deprecate 'open' #211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, SATySFi has 3 forms of
open
:open M
: globalopen
open M in expr
: localopen
M.(expr)
: lightweight localopen
Only (1) is related to this PR. The other 2 forms are irrelevant.
SATySFi's global
open
(hereafter, just callopen
) is similar to OCaml'sinclude
, not OCaml'sopen
, because it re-exports the definitions in a module.open
/include
in modules, wrap-up:open
include
open
include
open
open
In my experience with Standard ML, the absence of OCaml-style
open
is to some extent painful, even though Standard ML haslocal ... in ... end
, which makes Standard ML-styleopen
a bit more local.Moreover, we cannot omit module prefixes in signatures (in a natural way) if OCaml-style
open
is not supported. Compare these (contrived) OCaml programs:On the other hand, OCaml-style
include
is also useful, especially when combined with functors and to extend modules with additional definitions.So I believe both
open
andinclude
should be implemented in SATySFi. Since SATySFi has many similarities with OCaml, it would be appropriate to use the same keywords as OCaml. As a first step, this PR adds a keywordinclude
as an alias toopen
. Furthermore, if a program contains (global)open
, SATySFi warns about it, leading the programmer to refrain from usingopen
.Plan
I propose the following plan.
include
, and warn the use ofopen
. (What this PR does.)open
.open
.