Re: [swift-evolution] String update

2018-01-16 Thread Eneko Alonso via swift-evolution
/.exactDigits(3) + "-").oneOrZero + > /let routing: Int/.exactDigits(3) + "-" + > /let local: Int/.exactDigits(4) > ``` > > In this model, the `//` syntax will only be used for initial binding and > swifty transformations will build the final rege

Re: [swift-evolution] String update

2018-01-16 Thread Eneko Alonso via swift-evolution
Could it be possible to specify the regex type ahead avoiding having to specify the type of each captured group? let usPhoneNumber: Regex = / (\d{3}?) - (\d{3}) - (\d{4}) / “Verbose” alternative: let usPhoneNumber:

Re: [swift-evolution] [pitch] adding toggle to Bool

2018-01-13 Thread Eneko Alonso via swift-evolution
I am yet another one that tries to never use ! It feels like bad heritage from C, and it probably should be removed from Swift in the same way for(;;) and ++/-- where removed. ! does not provide any unique functionality, as it is redundant to “== false”. Other than syntax sugar, it does not

Re: [swift-evolution] 100% bikeshed topic: DictionaryLiteral

2018-01-09 Thread Eneko Alonso via swift-evolution
be initialized with the TableRow (maybe via Decodable). Given a proper name, this type could be really useful in many cases. Thanks, Eneko > On Jan 9, 2018, at 9:28 AM, Eneko Alonso via swift-evolution > <swift-evolution@swift.org> wrote: > > How about renaming Dictio

Re: [swift-evolution] 100% bikeshed topic: DictionaryLiteral

2018-01-09 Thread Eneko Alonso via swift-evolution
How about renaming DictionaryLiteral to Row, TabularRow or TableRow? I think most developers are familiar with the idea that a table row contains multiple columns (in specific order), and each column has a name and a value (key/value). Some other name suggestions: - Record (kind of an old name

Re: [swift-evolution] [Review] SE 0192 - Non-Exhaustive Enums

2018-01-02 Thread Eneko Alonso via swift-evolution
In regards of A, doesn’t this code cover al cases? @incomplete enum { case pancake case waffle case juice } When the @incomplete tag is present, the compiler enforces (with an error) that all switches handle a default case: switch breakfast { case .pancake: case .waffle: case

Re: [swift-evolution] namespacing protocols to other types

2017-12-29 Thread Eneko Alonso via swift-evolution
Modules do more than that. For instance, if two imported modules provide a type with the same name, you can distinguish (name-spacing) them by using ModuleA.Thing vs ModuleB.Thing. In regards of Modules being intended to be shipped separately, that is incorrect. You might be thinking of

Re: [swift-evolution] [Review] SE 0192 - Non-Exhaustive Enums

2017-12-28 Thread Eneko Alonso via swift-evolution
Hello everyone, My name is Eneko Alonso, iOS developer, new here on the list. Is there a good summary anywhere that condenses the pros and cons of this new feature that have been discussed so far? It is not clear to me why non-exhaustive would be the default, requiring adding `@exhaustive`