[swift-evolution] Transition to the Swift Forums is Complete!

2018-01-19 Thread Nicole Jacque via swift-evolution
<mailto:swift-infrastruct...@swift.org>, code-own...@swift.org, and cond...@swift.org will continue to work. See you in the Swift Forums! nicole___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo

Re: [swift-evolution] Transition to the Swift Forums -- mailing lists going into suspend mode

2018-01-17 Thread Nicole Jacque via swift-evolution
If there are > any unexpected delays, I’ll communicate that via the lists as well. In the > meantime, you can still communicate with me and the rest of the Swift > infrastructure team if necessary at infrastruct...@swift.org. > > Cheers! > nicole _____

[swift-evolution] Transition to the Swift Forums -- mailing lists going into suspend mode

2018-01-17 Thread Nicole Jacque via swift-evolution
...@swift.org. Cheers! nicole ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-17 Thread Saagar Jha via swift-evolution
Saagar Jha > On Jan 17, 2018, at 16:56, Xiaodi Wu via swift-evolution > <swift-evolution@swift.org> wrote: > > On Wed, Jan 17, 2018 at 2:04 AM, David Sweeris <daveswee...@mac.com > <mailto:daveswee...@mac.com>> wrote: > > > Sent from my iPhone >

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-17 Thread Xiaodi Wu via swift-evolution
On Wed, Jan 17, 2018 at 2:04 AM, David Sweeris <daveswee...@mac.com> wrote: > > > Sent from my iPhone > > > On Jan 16, 2018, at 23:45, Jonathan Hull via swift-evolution < > swift-evolution@swift.org> wrote: > > > > Mainly semantics. > > > &

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-17 Thread Xiaodi Wu via swift-evolution
On Wed, Jan 17, 2018 at 4:56 PM, Jonathan Hull via swift-evolution < swift-evolution@swift.org> wrote: > I’m with Nevin on this one. Perhaps the easiest thing to do is to add > something to the FloatLiteral type that lets you get it as a string if > desired. > > Didn’t

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Chris Lattner via swift-evolution
s. > > Connor > >>>> Is the problem the “one” case? If that is the problem, then it might be >>>> better to take a completely different approach where you embrace the fact >>>> that you have structured data producing 2D results that need to be >>>> displayed. Each result could either return an atomic result or a result >>>> that wraps some other recursive 2D presentation. >>> >>> No, the issue is that the playground logger would see that `Foo.two` >>> conforms to `CustomPlaygroundConvertible`, and would therefore call >>> `playgroundDescription` another time, which would return another `Foo.two`, >>> and this would continue endlessly. I plan to guard against that in >>> PlaygroundLogger with a limit on chaining, but this protocol should not >>> require a failsafe as a feature. >> >> Right, it seems like the best way to solve this is to provide explicit >> access to the default presentation. >> >> -Chris >> > ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-17 Thread Chris Lattner via swift-evolution
t it is a statement at the moment. But I don't > think it needs to be modeled as a statement attribute/modifier. A flag on > CaseStmt is fine. DeclModifiers are a syntax/parser thing, not a representational concept in the AST. Storing it as a bit would be fine, I’d also prefer that. -Chris

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-17 Thread Jordan Rose via swift-evolution
nk we have a statement modifier yet. That said, we’ve always >> planned to have them when the need arose. > > ‘case’ isn’t a decl in switches either. Nor is it a statement, the way things > are modeled today. Bleah, sorry, I forgot that it is a statement at the moment. But I don't think it needs to be modeled as a statement attribute/modifier. A flag on CaseStmt is fine. Jordan > But this is all implementation detail; it’s not interesting to discuss that. > > Jordan ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] String update

2018-01-17 Thread Michael Ilseman via swift-evolution
String)> > > On 16 Jan 2018, at 23:20, Michael Ilseman via swift-evolution > <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: > >> Significant leading zeros is a good point. Another would be >> non-default-radix. >> >>

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Connor Wakamo via swift-evolution
> On Jan 13, 2018, at 2:18 PM, Erica Sadun <er...@ericasadun.com> wrote: > > On Jan 11, 2018, at 1:40 PM, Jonathan Hull via swift-evolution > <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: >> >> >>> On Jan 11, 2

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Connor Wakamo via swift-evolution
> On Jan 13, 2018, at 8:20 AM, Karl Wagner <razie...@gmail.com> wrote: > > > >> On 13. Jan 2018, at 03:22, Connor Wakamo via swift-evolution >> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: >> >> >

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Connor Wakamo via swift-evolution
gt;>> displayed. Each result could either return an atomic result or a result >>> that wraps some other recursive 2D presentation. >> >> No, the issue is that the playground logger would see that `Foo.two` >> conforms to `CustomPlaygroundConvertible`, and would therefore call >> `playgroundDescription` another time, which would return another `Foo.two`, >> and this would continue endlessly. I plan to guard against that in >> PlaygroundLogger with a limit on chaining, but this protocol should not >> require a failsafe as a feature. > > Right, it seems like the best way to solve this is to provide explicit access > to the default presentation. > > -Chris > ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-17 Thread Jonathan Hull via swift-evolution
. I view this as a bug. Thanks, Jon > On Jan 16, 2018, at 4:20 PM, Nevin Brackett-Rozinsky via swift-evolution > <swift-evolution@swift.org> wrote: > > On Tue, Jan 16, 2018 at 6:31 PM, Xiaodi Wu <xiaodi...@gmail.com > <mailto:xiaodi...@gmail.com>> wrote:

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-17 Thread Jordan Rose via swift-evolution
t a decl, and I > don’t think we have a statement modifier yet. That said, we’ve always > planned to have them when the need arose. ‘case’ isn’t a decl in switches either. Nor is it a statement, the way things are modeled today. But this is all implementation detail; it’s not interesting to discuss that. Jordan ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-17 Thread Chris Lattner via swift-evolution
my proposal fits directly into that. The only extension is that ‘default’ isn’t a decl, and I don’t think we have a statement modifier yet. That said, we’ve always planned to have them when the need arose. -Chris_______ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] String update

2018-01-17 Thread David Hart via swift-evolution
ing] <- \w)* \s (let lastName: String <- \w+) / print(type(of: name)) // => Regex<(firstName: String, initials: [Character], lastName: String)> On 16 Jan 2018, at 23:20, Michael Ilseman via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>>

Re: [swift-evolution] Protocol conformance error

2018-01-17 Thread C. Keith Ray via swift-evolution
> On Jan 17, 2018, at 11:53 AM, Saagar Jha via swift-evolution > <swift-evolution@swift.org> wrote: > > Interestingly, it seems like Swift allows for contravariance for subclassing, > in that this is valid code: > > protocol A {} > protocol B: A {} > > cl

Re: [swift-evolution] Protocol conformance error

2018-01-17 Thread Paul Cantrell via swift-evolution
;func test(x: TestInput) >> } >> >> Curiously, the following does not work, although it seems like it should: >> >> protocol A {} >> protocol B: A {} >> >> protocol C { >>associatedtype TestOutput: A >> >>

Re: [swift-evolution] Protocol conformance error

2018-01-17 Thread Saagar Jha via swift-evolution
} > > class M: C { >func test() -> B { > fatalError("just a stub") >} > } > > It gives the error “inferred type 'B' (by matching requirement 'test()') is > invalid: does not conform to ‘A’” even though B does conform to A.

Re: [swift-evolution] Protocol conformance error

2018-01-17 Thread Paul Cantrell via swift-evolution
fatalError("just a stub") } } It gives the error “inferred type 'B' (by matching requirement 'test()') is invalid: does not conform to ‘A’” even though B does conform to A. Huh. Cheers, P > On Jan 17, 2018, at 2:43 AM, Saagar Jha via swift-evolution > <swift-ev

Re: [swift-evolution] No disjunctions in type constraints: why?

2018-01-17 Thread Robert Widmann via swift-evolution
. ~Robert Widmann 2018/01/13 4:45、Daryle Walker via swift-evolution <swift-evolution@swift.org>のメール: > From > <https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md#miscellaneous>. > > Maybe I’m not up on my Type Theory, but why should type constraint

Re: [swift-evolution] Protocol conformance error

2018-01-17 Thread Saagar Jha via swift-evolution
If we have: class N: A {} you can pass an N into C’s test(x:), since N is an A, but not M’s test(x:), since N is not a B. Thus, it’s not a valid conformance. Saagar Jha > On Jan 17, 2018, at 00:04, Roshan via swift-evolution > <swift-evolution@swift.org> wrote: > > Hi,

[swift-evolution] Protocol conformance error

2018-01-17 Thread Roshan via swift-evolution
test(x: B) {} } Is there a reason why the compiler doesn't infer that ((B) -> ()) matches ((A) -> ()) because of inheritance? -- Warm regards Roshan ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/li

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-17 Thread David Sweeris via swift-evolution
Sent from my iPhone > On Jan 16, 2018, at 23:45, Jonathan Hull via swift-evolution > <swift-evolution@swift.org> wrote: > > Mainly semantics. > > We could technically use Int instead of having a Bool type (just using 1 and > 0). We don’t do that since Int

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-16 Thread Jonathan Hull via swift-evolution
If you look at the implementation I provided, it allows for percentages higher than 100% (and has an easy way to clip them or map them to an arbitrary range). > On Jan 16, 2018, at 11:39 AM, Dave DeLong via swift-evolution > <swift-evolution@swift.org> wrote: > > > >

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-16 Thread Jonathan Hull via swift-evolution
l type, which is already available in the form of > Foundation.Decimal on all supported platforms. > > On Sat, Jan 13, 2018 at 9:07 PM, Jonathan Hull via swift-evolution > <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: > Here is the code I u

[swift-evolution] Reminder: Discourse transition starts tomorrow

2018-01-16 Thread Nicole Jacque via swift-evolution
outage time between > the mailing lists going down and the forums being ready. > > If you need to contact the Swift infrastructure team during the outage period > the infrastruct...@swift.org email will continue to work. > > Thanks! > nicole ______

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-16 Thread Xiaodi Wu via swift-evolution
could write: >> >> func moles(particles: T) >> -> T { >> let N_A = T("6.02214085774e+23")! >> return particles / N_A >> } >> > > …or I could write “T: FloatingPoint & ExpressibleByFloatLiteral”. I could > even make a typealias for that. But I shouldn’t have to. > Sure, you could do that too. Your solution here is actually probably the best, in that if a user wishes to conform a decimal type to ExpressibleByFloatLiteral, your extensions would also work for that type. I've already explained why the semantics of ExpressibleByFloatLiteral are such that not every FloatingPoint type could conform. ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-16 Thread Nevin Brackett-Rozinsky via swift-evolution
} >> >> It would be much nicer to write “let avogadroNumber: T = 6.022140857e23”. >> > > You could write: > > func moles(particles: T) > -> T { > let N_A = T("6.02214085774e+23")! > return particles / N_A > } > …or I could write “T: FloatingPoint & ExpressibleByFloatLiteral”. I could even make a typealias for that. But I shouldn’t have to. Nevin ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-16 Thread Rick Mann via swift-evolution
> On Jan 16, 2018, at 15:32 , Xiaodi Wu via swift-evolution > <swift-evolution@swift.org> wrote: > > On Jan 16, 2018, at 14:30 , Nevin Brackett-Rozinsky via swift-evolution > <swift-evolution@swift.org> wrote: >> >> That only works for numbers wh

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-16 Thread Xiaodi Wu via swift-evolution
On Tue, Jan 16, 2018 at 3:39 PM, Chris Lattner <clatt...@nondot.org> wrote: > >> On Jan 15, 2018, at 11:01 PM, Xiaodi Wu via swift-evolution < >> swift-evolution@swift.org> wrote: >> > - Can we change the semantics? Maybe, but I doubt >> ExpressibleByFloatLite

Re: [swift-evolution] String update

2018-01-16 Thread George Leontiev via swift-evolution
> On Jan 16, 2018, at 2:18 PM, Michael Ilseman via swift-evolution > <swift-evolution@swift.org> wrote: > > (Replying to both Eneko and George at once) > >>>>> I wonder if it is worth considering (for lack of a better word) *verbose*

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-16 Thread Nevin Brackett-Rozinsky via swift-evolution
Tue, Jan 16, 2018 at 3:39 PM, Chris Lattner <clatt...@nondot.org> wrote: > On Jan 15, 2018, at 11:01 PM, Xiaodi Wu via swift-evolution < > swift-evolution@swift.org> wrote: > > - Can we change the semantics? Maybe, but I doubt > ExpressibleByFloatLiteral can be out

Re: [swift-evolution] String update

2018-01-16 Thread Michael Ilseman via swift-evolution
Significant leading zeros is a good point. Another would be non-default-radix. > On Jan 16, 2018, at 12:22 PM, C. Keith Ray via swift-evolution > <swift-evolution@swift.org> wrote: > > people may want digits as characters in order to see zeros. parsing phone > number

Re: [swift-evolution] String update

2018-01-16 Thread Michael Ilseman via swift-evolution
along the way. I believe “verbal expressions” is basically what you’re describing: https://github.com/VerbalExpressions/SwiftVerbalExpressions > On Jan 16, 2018, at 11:24 AM, Eneko Alonso via swift-evolution > <swift-evolution@swift.org> wrote: > > Thank you for the reply.

Re: [swift-evolution] [swift-users] Cannot pass immutable value as inout argument

2018-01-16 Thread Adrian Zubarev via swift-evolution
Swift know it's const and just allow it to be a let? -- Rick Mann rm...@latencyzero.com ___ swift-users mailing list swift-us...@swift.org https://lists.swift.org/mailman/listinfo/swift-users _______ swift

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

2018-01-16 Thread Brent Royal-Gordon via swift-evolution
> On Jan 13, 2018, at 1:40 PM, Erica Sadun <er...@ericasadun.com> wrote: > > > >> On Jan 9, 2018, at 10:22 PM, Brent Royal-Gordon via swift-evolution >> <swift-evolution@swift.org> wrote: >> If we can't do this, I think we should call it someth

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-16 Thread Chris Lattner via swift-evolution
On Jan 15, 2018, at 11:01 PM, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote: > - Can we change the semantics? Maybe, but I doubt ExpressibleByFloatLiteral > can be outright replaced. You're not the first to wonder about how to design > an alternative protoc

Re: [swift-evolution] String update

2018-01-16 Thread C. Keith Ray via swift-evolution
com/keith_ray_resume_2014_long.pdf > On Jan 16, 2018, at 11:24 AM, Eneko Alonso via swift-evolution > <swift-evolution@swift.org> wrote: > > Digits could always be inferred to be numeric (Int) and they should always be > “exact” (to match "\d"): ______

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-16 Thread Dave DeLong via swift-evolution
> On Jan 16, 2018, at 9:56 AM, Jon Gilbert via swift-evolution > <swift-evolution@swift.org> wrote: > > No to this pitch, because a percentage can be higher than 100%. ☝️ One need only look in Activity Monitor to see this in action. > Use NumberFormatter to display a n

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] Handling unknown cases in enums [RE: SE-0192]

2018-01-16 Thread Jordan Rose via swift-evolution
> On Jan 14, 2018, at 09:36, Vladimir.S <sva...@gmail.com> wrote: > > > > On 12.01.2018 21:38, Jordan Rose wrote: >>> On Jan 12, 2018, at 06:49, Michel Fortin via swift-evolution >>> <swift-evolution@swift.org <mailto:swift-evolution@swift.o

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-16 Thread Jordan Rose via swift-evolution
aren't "top-level", but that's not a rule or anything. Jordan > > That said, I agree that the issue of source dependencies that might use this > is a significant problem. IMO, that argues strongly for “unknown default:” > producing a warning. > > -Chris > >&

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-16 Thread Jordan Rose via swift-evolution
other value") > } > > //Now use syntax sugar > switch myEnum.casesBelow { > case .a: print("a") > } > > > This would look more intuitive to me than other solutions but I am not sure > how much effort we need for this. > > > > On Mo

Re: [swift-evolution] String update

2018-01-16 Thread George Leontiev via swift-evolution
ting: 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 regex. > On Jan 16, 2018, at 9:20 AM, Eneko Alonso via swift-evolution > <swift-evolution@swift.org&g

Re: [swift-evolution] String update

2018-01-16 Thread Eneko Alonso via swift-evolution
Int, local: Int)> Thanks, Eneko > On Jan 16, 2018, at 8:52 AM, George Leontiev via swift-evolution > <swift-evolution@swift.org> wrote: > > Thanks, Michael. This is very interesting! > > I wonder if it is worth considering (for lack of a better word) *verbose* >

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-16 Thread Jon Gilbert via swift-evolution
> On Jan 13, 2018, at 18:26, Jonathan Hull via swift-evolution > <swift-evolution@swift.org> wrote: > > Hi Evolution, > > I was wondering if we would consider adding a percentage type to Swift. This > would be a type with a value between 0 & 1. > > I kno

Re: [swift-evolution] String update

2018-01-16 Thread George Leontiev via swift-evolution
te the addition of `UnicodeScalar` to the signature of `Regex`. Other interesting signatures are `Regex<JSONToken, JSONEnumeration>` or `Regex<HTTPRequestHeaderToken, HTTPRequestHeader>`. Building parsers becomes fun! - George > On Jan 10, 2018, at 11:58 AM, Michael Ilseman via swift-evolution >

Re: [swift-evolution] [Pitch] Angle Type

2018-01-16 Thread Erica Sadun via swift-evolution
> On Jan 15, 2018, at 2:40 PM, Stephen Canon via swift-evolution > <swift-evolution@swift.org> wrote: > > > >> On Jan 15, 2018, at 4:31 PM, Karl Wagner via swift-evolution >> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

Re: [swift-evolution] [Pitch] Angle Type

2018-01-16 Thread Karl Wagner via swift-evolution
> On 15. Jan 2018, at 23:55, Taylor Swift <kelvin1...@gmail.com> wrote: > > > > On Jan 15, 2018, at 3:30 PM, Karl Wagner <razie...@gmail.com > <mailto:razie...@gmail.com>> wrote: > >> >> >>> On 14. Jan 2018, at 21:12, K

[swift-evolution] Pure functions

2018-01-16 Thread Daryle Walker via swift-evolution
to build your own pure functions? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Xiaodi Wu via swift-evolution
g on it), DecimalFloatingPoint become a standard library protocol, and `0.1` become a "decimal literal" (with Float, Double, Float80, and Decimal64/128 all conforming) as distinct from a "float literal" that we could then restrict to hexadecimal (?and binary) floating-point litera

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

2018-01-15 Thread Ted Kremenek via swift-evolution
Hi Nevin, I think this is an interesting perspective. For me it begets the question of how an API “gets finalized”. Currently anything that goes through the Swift Evolution proposal process that gets ratified is considered an official change to the language and Standard Library. That feels

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Nevin Brackett-Rozinsky via swift-evolution
his thread to have, so if there is any other conversation going on here then *that* is the different one. :-) Nevin _______ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

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

2018-01-15 Thread Ted Kremenek via swift-evolution
older Swift apps that aren’t rebuilt with a newer compiler) essentially the two runtimes are designed to essentially ignore each other. > On Jan 15, 2018, at 11:48 AM, Wallacy via swift-evolution > <swift-evolution@swift.org> wrote: > > This. I asked that already and they not

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Xiaodi Wu via swift-evolution
y chosen. If you want to argue that, after we fix the buggy implementation of > ExpressibleByFloatLiteral, then we should introduce a new protocol named > ExpressibleByBinaryFloatLiteral, that might be a discussion worth having. > But for the existing protocol, renaming it would not solve the und

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Nevin Brackett-Rozinsky via swift-evolution
leByBinaryFloatLiteral, that might be a discussion worth having. But for the existing protocol, renaming it would not solve the underlying issue. Nevin _______ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Xiaodi Wu via swift-evolution
ons or enhancements are something that can wait. Nevin > > > On Mon, Jan 15, 2018 at 7:41 PM, Xiaodi Wu <xiaodi...@gmail.com> wrote: > >> On Mon, Jan 15, 2018 at 4:24 PM, Nevin Brackett-Rozinsky via >> swift-evolution <swift-evolution@swift.org>

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Nevin Brackett-Rozinsky via swift-evolution
com> wrote: > On Mon, Jan 15, 2018 at 4:24 PM, Nevin Brackett-Rozinsky via > swift-evolution <swift-evolution@swift.org> wrote: > >> Currently, the FloatingPoint protocol does not conform to >> ExpressibleByFloatLiteral, whereas BinaryFloatingPoint does. >

Re: [swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Xiaodi Wu via swift-evolution
On Mon, Jan 15, 2018 at 4:24 PM, Nevin Brackett-Rozinsky via swift-evolution <swift-evolution@swift.org> wrote: > Currently, the FloatingPoint protocol does not conform to > ExpressibleByFloatLiteral, whereas BinaryFloatingPoint does. > > The only explanation I can find f

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Taylor Swift via swift-evolution
> On Jan 15, 2018, at 3:40 PM, Stephen Canon <sca...@apple.com> wrote: > > > >>> On Jan 15, 2018, at 4:31 PM, Karl Wagner via swift-evolution >>> <swift-evolution@swift.org> wrote: >>> >>> On 14. Jan 2018, at 21:12, Kelvin M

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Taylor Swift via swift-evolution
> On Jan 15, 2018, at 3:30 PM, Karl Wagner <razie...@gmail.com> wrote: > > > >> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution >> <swift-evolution@swift.org> wrote: >> >> This could work, but you’re also giving up all the nice Num

[swift-evolution] FloatingPoint does not conform to ExpressibleByFloatLiteral

2018-01-15 Thread Nevin Brackett-Rozinsky via swift-evolution
Currently, the FloatingPoint protocol does not conform to ExpressibleByFloatLiteral, whereas BinaryFloatingPoint does. The only explanation I can find for this is a brief comment from Steve Canon <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160425/015691.html>

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Stephen Canon via swift-evolution
> On Jan 15, 2018, at 4:31 PM, Karl Wagner via swift-evolution > <swift-evolution@swift.org> wrote: > >> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution >> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: >> >

Re: [swift-evolution] [Pitch] Angle Type

2018-01-15 Thread Karl Wagner via swift-evolution
> On 14. Jan 2018, at 21:12, Kelvin Ma via swift-evolution > <swift-evolution@swift.org> wrote: > > This could work, but you’re also giving up all the nice Numeric and > FloatingPoint conformances when you use this,, all of a sudden adding two > angles together isn

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

2018-01-15 Thread Nevin Brackett-Rozinsky via swift-evolution
a valuable purpose going forward. Nevin On Sun, Jan 14, 2018 at 9:04 PM, Ted Kremenek via swift-evolution < swift-evolution@swift.org> wrote: > > > > On Jan 12, 2018, at 11:23 PM, Chris Lattner <clatt...@nondot.org> wrote: > > > > On Jan 12, 2018, at 4:43

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

2018-01-15 Thread Wallacy via swift-evolution
Core.dylib, but if need to use a specific feature on libswiftCore_4.1.dylib why not. Em seg, 15 de jan de 2018 às 16:54, Jacob Williams via swift-evolution < swift-evolution@swift.org> escreveu: > Pardon my lack of knowledge in this area, but is there not also a 3rd > option av

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

2018-01-15 Thread Jacob Williams via swift-evolution
on this area of Swift. > On Jan 12, 2018, at 5:43 PM, Ted Kremenek via swift-evolution > <swift-evolution@swift.org> wrote: > > Hi Chris, > > Instead of responding to each of your point bit-by-bit, I’ll try a different > tactic to explain my reasoning — which may be

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-14 Thread Tim Wang via swift-evolution
uot;other value") } //Now use syntax sugar switch myEnum.casesBelow { case .a: print("a") } This would look more intuitive to me than other solutions but I am not sure how much effort we need for this. On Mon, Jan 15, 2018 at 4:36 AM Vladimir.S via swift-evolution <

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

2018-01-14 Thread Dmitri Gribenko via swift-evolution
On Mon, Jan 8, 2018 at 4:29 PM, Ben Cohen via swift-evolution <swift-evolution@swift.org> wrote: > There exists in the standard library a type `DictionaryLiteral` that deserves > naming re-consideration before we declare ABI Stability, because it’s > confusingly misnamed

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

2018-01-14 Thread Ted Kremenek via swift-evolution
he impact in code size to the Standard >> Library of removing Mirrors, but I hypothesize it is relatively modest (I >> will look at verifying this hypothesis). > > I agree. The major motivation from my side isn’t the code size reduction, it > is that we’ll have a better and brighter future with more clarity and less > weird cruft left over - like the “DictionaryLiteral” type that sparked this > whole thread. Have you looked at it? It’s crazy. :-) I think a bright future is still possible in either scenario. From what I can tell, if we don’t do anything, in the worst case there is some baggage left in libswiftCore.dylib for the purposes of binary compatibility with older apps. We still are left with the opportunity to deprecate those APIs in the future even if we can’t rip those symbols out now. ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] [Review] SE-0194: Derived Collection of Enum Cases

2018-01-14 Thread Hooman Mehr via swift-evolution
be tuples of each case value and another literal (an enum case maybe) that represents the availability metadata for that case. Hooman > On Jan 14, 2018, at 8:16 AM, Ben Rimmington via swift-evolution > <swift-evolution@swift.org> wrote: > > An alternative is a special #knownCases(of:)

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Kelvin Ma via swift-evolution
(_:) static functions? i really only use static constructors for initializers that have side effects On Sun, Jan 14, 2018 at 6:36 AM, Karl Wagner <razie...@gmail.com> wrote: > > > On 14. Jan 2018, at 09:51, Taylor Swift via swift-evolution < > swift-evolution@swift.org> wrote: &g

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-14 Thread Vladimir.S via swift-evolution
On 12.01.2018 21:38, Jordan Rose wrote: On Jan 12, 2018, at 06:49, Michel Fortin via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: Le 12 janv. 2018 à 4:44, Vladimir.S via swift-evolution <swift-evolution@swift.org <mailto:swift-e

Re: [swift-evolution] [Review] SE-0194: Derived Collection of Enum Cases

2018-01-14 Thread Ben Rimmington via swift-evolution
/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md > > <https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md>] > > I think this is generally reasonable, and none of the names offend me enough >

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Karl Wagner via swift-evolution
> On 14. Jan 2018, at 06:04, BJ Homer via swift-evolution > <swift-evolution@swift.org> wrote: > > An Angle type already exists in Foundation; see Measurement. You > could add some convenience methods in an extension pretty easily. > > import Foundation > &

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Karl Wagner via swift-evolution
> On 14. Jan 2018, at 09:51, Taylor Swift via swift-evolution > <swift-evolution@swift.org> wrote: > > I do a lot of geometry and spherical-related work and i have never found an > Angle type to be worth having. Always use radians. It’s what sin() and cos() > take,

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

2018-01-14 Thread Georgios Moschovitis via swift-evolution
ability. -g. ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] [Pitch] Angle Type

2018-01-14 Thread Taylor Swift via swift-evolution
on every angle value? that really adds up when you’re converting 100,000s of lat-long pairs to cartesian. > On Jan 14, 2018, at 12:04 AM, BJ Homer via swift-evolution > <swift-evolution@swift.org> wrote: > > An Angle type already exists in Foundation; see Measurement. You

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

2018-01-13 Thread Eneko Alonso via swift-evolution
018, at 14:34, Anders Kierulf via swift-evolution > <swift-evolution@swift.org> wrote: > > I also avoid using ! for negation when possible, and `toggle` or `invert` > will be helpful, but in many cases I think the negative case is better > expressed directly. For example, I f

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread Xiaodi Wu via swift-evolution
On Sat, Jan 13, 2018 at 10:29 PM, Erica Sadun via swift-evolution < swift-evolution@swift.org> wrote: > I think a full random implementation should be decoupled from Swift's > standard library and generic random is overkill. > > In-language, I think pre-seeded rando

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-13 Thread Xiaodi Wu via swift-evolution
of Foundation.Decimal on all supported platforms. On Sat, Jan 13, 2018 at 9:07 PM, Jonathan Hull via swift-evolution < swift-evolution@swift.org> wrote: > Here is the code I use for percentage myself. (I incorrectly said I use a > UInt64… I use a UInt32): > > ///Represents a percentage

Re: [swift-evolution] [Pitch] Angle Type

2018-01-13 Thread BJ Homer via swift-evolution
(to: .radians).value return sin(radians) } static var threeQuarterTurn: Angle { return Angle(value: 0.75, unit: .revolutions) } } let x = Angle.threeQuarterTurn x.sine // -1 -BJ > On Jan 13, 2018, at 9:31 PM, Erica Sadun via swift-evolution > <swift-

Re: [swift-evolution] [Pitch] Angle Type

2018-01-13 Thread Erica Sadun via swift-evolution
https://gist.github.com/erica/ee06008202c9fed699bfa6254c42c721 <https://gist.github.com/erica/ee06008202c9fed699bfa6254c42c721> and * https://github.com/erica/SwiftGeometry > On Jan 13, 2018, at 7:49 PM, Jonathan Hull via swift-evolution > <swift-evolution@swift.org> wrote: > &

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread Erica Sadun via swift-evolution
ection (`collection.randomIndex()`) is more than sufficient, assuming sufficient doc warnings that none of this is suitable for encryption or gambling. -- E > On Jan 13, 2018, at 6:48 PM, Jonathan Hull via swift-evolution > <swift-evolution@swift.org> wrote: > > Basically, my point i

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread David Waite via swift-evolution
which (with all that complexity) still isn’t a uniform distribution! Thats completely ignoring some of the finer issues you get with floating point numbers as you certain transforms of a [0,1] distribution -DW > On Jan 13, 2018, at 7:41 PM, C. Keith Ray via swift-evolution > <swift-ev

Re: [swift-evolution] [Pitch] Percentage Type

2018-01-13 Thread Jonathan Hull via swift-evolution
static func * (lhs:Num, rhs:Percentage)->Num { return lhs * rhs.numValue } static func * (lhs:Percentage, rhs:Percentage)->Percentage { return Percentage(lhs.decimalValue * rhs.decimalValue) } } > On Jan 13, 2018, at 6:26 PM, Jonathan Hull via

[swift-evolution] [Pitch] Angle Type

2018-01-13 Thread Jonathan Hull via swift-evolution
, and it stops us from adding all of these angle-specific niceties. Happy to provide code if there is interest… Thanks, Jon___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread C. Keith Ray via swift-evolution
<- buy my book? http://agilesolutionspace.blogspot.com/ twitter: @ckeithray http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf > On Jan 13, 2018, at 6:15 PM, Jonathan Hull via swift-evolution > <swift-evolution@swift.org> wrote: > > >> On Jan 1

Re: [swift-evolution] Handling unknown cases in enums [RE: SE-0192]

2018-01-13 Thread Chris Lattner via swift-evolution
ift-evolution > <swift-evolution@swift.org> wrote: > > >> On Jan 12, 2018, at 3:08 PM, Jordan Rose <jordan_r...@apple.com> wrote: >> >> Okay, I went back to `unknown case` in the proposal, but mentioned Chris's >> point very specifically: if the compiler emit

[swift-evolution] [Pitch] Percentage Type

2018-01-13 Thread Jonathan Hull via swift-evolution
nks, Jon ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread Jonathan Hull via swift-evolution
> On Jan 12, 2018, at 8:22 PM, Nate Cook <natec...@apple.com> wrote: > > On Jan 12, 2018, at 6:24 PM, Jonathan Hull via swift-evolution > <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: > >> I think we have different

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread Jonathan Hull via swift-evolution
ay random is used would likely lead to less opportunities for a trap than >>> the other methods you mention. >>> >>> >>> Letanyan >>> >>>> On 12 Jan 2018, at 04:39, Alejandro Alonso <aalonso...@outlook.com >>>>

Re: [swift-evolution] [Proposal] Random Unification

2018-01-13 Thread Jonathan Hull via swift-evolution
r a trap than >>> the other methods you mention. >>> >>> >>> Letanyan >>> >>>> On 12 Jan 2018, at 04:39, Alejandro Alonso <aalonso...@outlook.com >>>> <mailto:aalonso...@outlook.com>> wrote: >>>> >

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

2018-01-13 Thread David Sweeris via swift-evolution
> On Jan 11, 2018, at 22:15, Chris Eidhof via swift-evolution > <swift-evolution@swift.org> wrote: > > Hey SE! > > When we have a bunch of nested structs: > > struct Sample { > var bar: Bar > } > > struct Bar { >

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-13 Thread Erica Sadun via swift-evolution
Perhaps bring the three special case literals into this as well? (File, image, color) -- E > On Jan 9, 2018, at 4:53 PM, Ben Cohen via swift-evolution > <swift-evolution@swift.org> wrote: > > Big +1 to this. Getting these types out of the standard library and into a >

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

2018-01-13 Thread Erica Sadun via swift-evolution
On Jan 13, 2018, at 12:06 PM, Karl Wagner via swift-evolution <swift-evolution@swift.org> wrote: > >> On 12. Jan 2018, at 20:54, Alejandro Martinez via swift-evolution >> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: >> >&g

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

2018-01-13 Thread Erica Sadun via swift-evolution
> On Jan 9, 2018, at 10:22 PM, Brent Royal-Gordon via swift-evolution > <swift-evolution@swift.org> wrote: > If we can't do this, I think we should call it something like `PairArray` or > `KeyValueArray` Or "KeyValueList", which avoids both "Dic

Re: [swift-evolution] No disjunctions in type constraints: why?

2018-01-13 Thread Saagar Jha via swift-evolution
{ foo.doFoo() } doSomethingWithAFooable(0) // prints: I’m an Int doSomethingWithAFooable("") // prints: I’m a String Saagar Jha > On Jan 13, 2018, at 01:45, Daryle Walker via swift-evolution > <swift-evolution@swift.org> wrote: > > From > &l

  1   2   3   4   5   6   7   8   9   10   >