Module Blocks

86 views
Skip to first unread message

Bryce Glover

unread,
Jul 1, 2017, 9:59:26 PM7/1/17
to mod...@isocpp.org
To Whom It May Concern, 

     Did anybody ever consider allowing syntax along the following lines for the Modules TS?  I mean, like this:  

```
module M {
  /* … */
}
```

This would be as opposed to just putting `module M;` at or near the beginning of a translation unit.  I don’t recall ever seeing anything of the sort floated around, but perhaps this could be due to a decision to only allow all of a particular translation unit to be part of one module — that is, that one cannot export different entities from a single translation unit into multiple different modules?  In that case, I could see why such a scoping construct might be seen as redundant from some perspectives, but I’m not sure that omitting it meshes well with how opening a module to add new entities (and/or macros, if those end up being allowed) opens a sort of scope.  Perhaps these curly braces are just or could just be made an optional set of delimiters that a programmer could choose to eliminate to get the currently proposed semantics?  

Curious, 
     Bryce Glover
Reply all
Reply to author
Forward
0 new messages