[swift-evolution] [Proposal][Discussion] Modular Swift

Jaden Geller jaden.geller at gmail.com
Tue Feb 21 00:45:26 CST 2017


Oh, you’re referring to the fact that a submodule under this proposal must be contained within braces? It would be purely additive to, in the future, annotate that the outer scope of a file is part of some given submodule.

Consider the following the following straw-man syntax that might be equivalent to `module Bar { func foo() { } }`:
```
module Bar follows // <- at top of file, indicating rest of file is submodule

func foo() { }
```

Does this address your question?

Thanks,
Jaden Geller

> On Feb 20, 2017, at 10:39 PM, Jonathan Hull <jhull at gbis.com> wrote:
> 
> 
>> On Feb 20, 2017, at 6:42 PM, Jaden Geller <jaden.geller at gmail.com <mailto:jaden.geller at gmail.com>> wrote:
>> 
>> Jon,
>> 
>> I think we might have miscommunicated. It is intended that outermost module is implicit; no `module` declaration is required to wrap every file. We tried to show this in the first code snippet.
>> 
>> What do you mean “covering only part of a file”?
> 
> I am assuming that the ModuleName { … }  only affects things within the brackets.  Thus it is possible for only part of a file to be within a module.  What are the benefits of allowing this, and are they worth the added complexity?
> 
> Thanks,
> Jon
> 
> 
>> Cheers,
>> Jaden Geller
>> 
>>> On Feb 20, 2017, at 6:36 PM, Jonathan Hull via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> What is the rational for having modules covering only part of a file?  Wouldn’t it be less clutter to have an annotation which worked for the whole file.  At the very least it would be nice to have an option to spell it in a way that applies to the whole file.  Otherwise, everything will be indented another level.
>>> 
>>> I would honestly love to see something which just maps modules to folders/groups for simplicity sake.
>>> 
>>> I haven’t thought about it too much yet, so I could easily be missing something obvious...
>>> 
>>> Thanks,
>>> Jon
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170220/b2ab8458/attachment.html>


More information about the swift-evolution mailing list