Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-03 Thread Vladimir.S via swift-evolution
On 02.07.2016 2:59, Dave Abrahams via swift-evolution wrote: on Fri Jul 01 2016, Adrian Zubarev wrote: The only problem I can see with ExpressibleAs is that it also reads if I could potentially do something like this type <-> literal, People keep going down that road, but I don't see why.

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Dave Abrahams via swift-evolution
on Fri Jul 01 2016, Adrian Zubarev wrote: > The only problem I can see with ExpressibleAs is that it also reads if > I could potentially do something like this type <-> literal, People keep going down that road, but I don't see why. As far as I know, “A is expressible as B” has never implied

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread David Sweeris via swift-evolution
Yeah, I’ve been wondering if there’d ever be a way to convert something into a *Literal… I can’t think of why, other than as a way to cast between types which are both “ExpressibleAs*Literal", but then the protocol would have to be strengthened to indicate that the conversion had to be lossless.

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Adrian Zubarev via swift-evolution
The only problem I can see with ExpressibleAs is that it also reads if I could potentially do something like this type <-> literal, but the direction type -> literal is impossible. --  Adrian Zubarev Sent with Airmail Am 1. Juli 2016 um 23:33:19, Matthew Johnson via swift-evolution (swift-ev

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Matthew Johnson via swift-evolution
> On Jul 1, 2016, at 3:59 PM, Dmitri Gribenko via swift-evolution > wrote: > > On Fri, Jul 1, 2016 at 1:35 PM, Dave Abrahams via swift-evolution > wrote: >> I think if `Syntax.IntegerLiteral` is actually unclear then the best >> cure is `ExpressibleAsIntegerLiteral` (no namespace needed). Non

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Dmitri Gribenko via swift-evolution
On Fri, Jul 1, 2016 at 1:35 PM, Dave Abrahams via swift-evolution wrote: > I think if `Syntax.IntegerLiteral` is actually unclear then the best > cure is `ExpressibleAsIntegerLiteral` (no namespace needed). None of > the other suggestions I've seen describe what the protocol means as well > as th

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Vladimir.S via swift-evolution
On 01.07.2016 23:39, Xiaodi Wu via swift-evolution wrote: I thought your suggestion of IntegerLiteralExpressible (with or without Syntax) was nice too. Support. I still believe that Syntax.IntegerLiteralExpressible is the best. We see 'Syntax' first, then 'Integer' just after point, 'Expressibl

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Xiaodi Wu via swift-evolution
I thought your suggestion of IntegerLiteralExpressible (with or without Syntax) was nice too. On Fri, Jul 1, 2016 at 15:35 Dave Abrahams via swift-evolution < swift-evolution@swift.org> wrote: > > on Fri Jul 01 2016, Erica Sadun wrote: > > > The best way to pass the Dave Test is to ask him direct

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Dave Abrahams via swift-evolution
on Fri Jul 01 2016, Erica Sadun wrote: > The best way to pass the Dave Test is to ask him directly, for example: > > Dave: > > Do you think the stdlib team would be okay with a naming scheme like > Syntax.Literal.ArrayProtocol, Syntax.Literal.IntegerProtocol, etc. We think > this produces a c

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Matthew Johnson via swift-evolution
> On Jul 1, 2016, at 11:00 AM, Erica Sadun wrote: > > The best way to pass the Dave Test is to ask him directly, for example: > > Dave: > > Do you think the stdlib team would be okay with a naming scheme like > Syntax.Literal.ArrayProtocol, Syntax.Literal.IntegerProtocol, etc. We think > th

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Shawn Erickson via swift-evolution
I would print it out and staple a $20 to the back of it and drop it his way with a wink. ...on a more serious note I like this naming suggestion. +1 from me On Fri, Jul 1, 2016 at 9:00 AM Erica Sadun via swift-evolution < swift-evolution@swift.org> wrote: > The best way to pass the Dave Test is t

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Erica Sadun via swift-evolution
The best way to pass the Dave Test is to ask him directly, for example: Dave: Do you think the stdlib team would be okay with a naming scheme like Syntax.Literal.ArrayProtocol, Syntax.Literal.IntegerProtocol, etc. We think this produces a clear description of the conformant role and one that i

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread David Sweeris via swift-evolution
If we go with the “Compiler” alternative, it might make sense to put things like the language/toolchain version, host, target, etc there: if Compiler.language.version >= 3 { celebrate() } if Compiler.target.cpuCount * Compiler.target.coreCount > someValue {/* parallelize something differently tha

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-07-01 Thread Adrian Zubarev via swift-evolution
We haven’t pass the dave test yet? :D Still curious what he’d say about Syntax.Literal.*Protocol One more question: What can the namespace Syntax could be used for except for literals, any idea? (I have no clue.) --  Adrian Zubarev Sent with Airmail Am 30. Juni 2016 um 03:30:15, Matthew John

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Matthew Johnson via swift-evolution
> On Jun 29, 2016, at 5:04 PM, Brent Royal-Gordon > wrote: > >> On Jun 29, 2016, at 7:41 AM, Matthew Johnson via swift-evolution >> wrote: >> >> `Syntax.IntegerLiteralType` is another that popped into my mind this >> morning. I don’t recall if that has been mentioned yet. The idea here is

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Matthew Johnson via swift-evolution
> On Jun 29, 2016, at 7:57 PM, David Waite via swift-evolution > wrote: > > I’m a bit late throwing my hat into the naming ring, but I was thinking > > Swift.Literal.IntegerInitializable, NilInitializable, > StringInterpolationInitializable, etc. Dave has explained why the `Initializable` su

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread David Waite via swift-evolution
I’m a bit late throwing my hat into the naming ring, but I was thinking Swift.Literal.IntegerInitializable, NilInitializable, StringInterpolationInitializable, etc. -DW > On Jun 29, 2016, at 9:10 AM, Adrian Zubarev via swift-evolution > wrote: > > Since bikeshedding ideas in here abusing a c

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Brent Royal-Gordon via swift-evolution
> On Jun 29, 2016, at 7:41 AM, Matthew Johnson via swift-evolution > wrote: > > `Syntax.IntegerLiteralType` is another that popped into my mind this morning. > I don’t recall if that has been mentioned yet. The idea here is that an > integer literal *can be typed as* a type that conforms to

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Nate Cook via swift-evolution
Nate > On Jun 28, 2016, at 3:57 PM, Dave Abrahams via swift-evolution > wrote: > > >> on Thu Jun 23 2016, Nate Cook wrote: >> >> I like the namespace-based approach to group these protocols together >> and I'm very happy to see some clarification happening in this group >> of protocols. Ho

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread David Sweeris via swift-evolution
> On Jun 29, 2016, at 9:05 AM, Stephen Canon wrote: > > We’re a little bit off in the weeds here =) I was only providing examples of why we might not want to tie `Arithmetic` to, um I think `Syntax.Literal.Integer` is the latest suggestion. I know they aren’t perfect, but they all seem to be

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Adrian Zubarev via swift-evolution
Okay I must correct myself. This wouldn’t work if it was a module, nested types behave differently. I’m sorry for any confusion. --  Adrian Zubarev Sent with Airmail Am 29. Juni 2016 um 17:32:46, Adrian Zubarev (adrian.zuba...@devandartist.com) schrieb: By the way, what we’ve not have discus

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Adrian Zubarev via swift-evolution
By the way, what we’ve not have discussed here yet is if we want to use this new protocols like this: extension SomeType : ArrayProtocol { … } Or extension SomeType : Syntax.Literal.ArrayProtocol { … } Closed enums will allow us to use ArrayProtocol where groups won’t. Just wanted to add this t

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Adrian Zubarev via swift-evolution
Since bikeshedding ideas in here abusing a closed enum anyway I’d like to share my vision of this proposal in a future release with pitched group mechanism (proposal link) and nested protocols in mind: public group Syntax { // No need for `public` because groups inherit // the ac

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Matthew Johnson via swift-evolution
> On Jun 29, 2016, at 9:46 AM, Adrian Zubarev via swift-evolution > wrote: > > I wouldn’t use the Type suffix, because I believe this will create even more > confusion with the associatedtype IntegerLiteralType from the current > IntegerLiteralConvertible itself. > > Thanks for pointing th

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Adrian Zubarev via swift-evolution
I wouldn’t use the Type suffix, because I believe this will create even more confusion with the associatedtype IntegerLiteralType from the current IntegerLiteralConvertible itself. --  Adrian Zubarev Sent with Airmail Am 29. Juni 2016 um 16:42:02, Matthew Johnson (matt...@anandabits.com) schr

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Matthew Johnson via swift-evolution
> On Jun 29, 2016, at 9:15 AM, Erica Sadun via swift-evolution > wrote: > > I rather like this one. It produces: `Syntax.Literal.IntegerProtocol`, which > is honestly > the best I've seen so far *and* it might get past the Dave test. I’m curious to see what Dave thinks of this as well. `S

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Erica Sadun via swift-evolution
I rather like this one. It produces: `Syntax.Literal.IntegerProtocol`, which is honestly the best I've seen so far *and* it might get past the Dave test. Thank you for bringing this into the conversation! -- E > On Jun 29, 2016, at 12:31 AM, Adrian Zubarev via swift-evolution > wrote: > > H

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Stephen Canon via swift-evolution
On Jun 29, 2016, at 9:33 AM, David Sweeris wrote: > Types where it makes sense, or types for which such semantics would be a good > idea? Because, for example, you could do something like this: > struct HTMLParser : IntegerLiteralConvertible { > init(integerLiteral value: IntegerLiteralType)

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread David Sweeris via swift-evolution
Types where it makes sense, or types for which such semantics would be a good idea? Because, for example, you could do something like this: struct HTMLParser : IntegerLiteralConvertible { init(integerLiteral value: IntegerLiteralType) { htmlMajorVersion = value htmlMinorVersion

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Steve Canon via swift-evolution
Semi-serious question for integer literals in particular: do we need a separate protocol at all? Are there types we want to support where integer literals should be supported, but + doesn't make sense? Where 1+1 actually isn't 2? If not, are integer literals really just part of Arithmetic? -

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread Vladimir.S via swift-evolution
I read such names as "Syntax.BlaBlaBlaBlaBlaBlaLiteral", then need to parse "Literal" at the end, then need to parse actual literal type(Integer,Nil,etc). Not clear from first view on such the name. FWIW as non-English speaker, I prefer clear and short name like "Syntax.IntegerLiteral" or even

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-29 Thread David Sweeris via swift-evolution
I think +1 on the "nested namespace" idea, unless we'll (no pun intended) literally never use this for anything else. - Dave Sweeris > On Jun 29, 2016, at 01:31, Adrian Zubarev via swift-evolution > wrote: > > How about: > > public enum Syntax { > > public enum Literal { > >

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Adrian Zubarev via swift-evolution
Wow so much sarcasm in this thread! *thumbs up* --  Adrian Zubarev Sent with Airmail Am 29. Juni 2016 um 08:55:18, Dave Abrahams via swift-evolution (swift-evolution@swift.org) schrieb: > Arg. Dang it! > > Syntax.ExpressibleAsIntegerLiteral +1 IMO it's not possible to improve on that one. _

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Adrian Zubarev via swift-evolution
And just as a side note: the example does work like this: func f() -> T { return T(integerLiteral: 43 as! T.IntegerLiteralType) // Error } func g() -> T { return T(integerLiteral: 43) } let test: Int = f() let test2: Int = g() I assume everyone does know that. The example by itself

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Dave Abrahams via swift-evolution
on Tue Jun 28 2016, Sean Heber wrote: > Arg. Dang it! > > Syntax.ExpressibleAsIntegerLiteral +1 IMO it's not possible to improve on that one. > Syntax.FromIntegerLiteral > Syntax.IntegerLiteralManifestation > Syntax.GhostOfIntegerLiteral > Syntax.FormerlyKnownAsIntegerLiteral > > l8r > Sean

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Dave Abrahams via swift-evolution
on Tue Jun 28 2016, Erica Sadun wrote: >> On Jun 28, 2016, at 9:21 PM, Sean Heber wrote: >> >> IntegerLiteralExpressable? >> >> Does Apple employ any philosophers? We might need one... >> >> l8r >> Sean >> > > Aand...welcome to last night. > > The problem being, that people see this and

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Adrian Zubarev via swift-evolution
That silly autocorrection sometimes: As I already said, literals will be read and converted to an actual type, but to adopt this, your type needs conformance to a protocol (sounds trivial?). --  Adrian Zubarev Sent with Airmail Am 29. Juni 2016 um 08:44:58, Adrian Zubarev (adrian.zuba...@deva

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Adrian Zubarev via swift-evolution
In fact this doesn’t tell you that you can do this: func f() -> T { return T(integerLiteral: 43) // Error return T(43) // Also an Error } As I already said, literals will be read and converted to an actual type, but to adopt this, your time needs conformance to a protocol (sounds trivial

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Adrian Zubarev via swift-evolution
How about: public enum Syntax { public enum Literal { public typealias NilProtocol = ... public typealias BooleanProtocol = ... public typealias IntegerProtocol = ... public typealias FloatProtocol = ... public typealias UnicodeScalarProtocol = ..

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Sean Heber via swift-evolution
Now that's just silly! l8r Sean Sent from my iPad > On Jun 28, 2016, at 10:49 PM, Greg Titus wrote: > > I’m honestly shocked that y’all (that I’ve seen) haven’t come up with > Syntax.LiterallyIntegerLiteral yet. > > > >> On Jun 28, 2016, at 8:39 PM, Sean Heber via swift-evolution >> wrot

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Greg Titus via swift-evolution
I’m honestly shocked that y’all (that I’ve seen) haven’t come up with Syntax.LiterallyIntegerLiteral yet. > On Jun 28, 2016, at 8:39 PM, Sean Heber via swift-evolution > wrote: > > Arg. Dang it! > > Syntax.ExpressibleAsIntegerLiteral > Syntax.FromIntegerLiteral > Syntax.IntegerLiteralManife

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Sean Heber via swift-evolution
Arg. Dang it! Syntax.ExpressibleAsIntegerLiteral Syntax.FromIntegerLiteral Syntax.IntegerLiteralManifestation Syntax.GhostOfIntegerLiteral Syntax.FormerlyKnownAsIntegerLiteral l8r Sean Sent from my iPad On Jun 28, 2016, at 10:29 PM, Erica Sadun wrote: >> On Jun 28, 2016, at 9:21 PM, Sean Heb

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Erica Sadun via swift-evolution
> On Jun 28, 2016, at 9:21 PM, Sean Heber wrote: > > IntegerLiteralExpressable? > > Does Apple employ any philosophers? We might need one... > > l8r > Sean > Aand...welcome to last night. The problem being, that people see this and think that the type can be expressed as an integer liter

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Sean Heber via swift-evolution
IntegerLiteralExpressable? Does Apple employ any philosophers? We might need one... l8r Sean Sent from my iPad > On Jun 28, 2016, at 10:02 PM, Erica Sadun wrote: > > >> On Jun 28, 2016, at 8:08 PM, Sean Heber wrote: >> >> What about.. >> >> Syntax.ConvertibleFromIntegerLiteral >> etc.. >

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Erica Sadun via swift-evolution
> On Jun 28, 2016, at 8:08 PM, Sean Heber wrote: > > What about.. > > Syntax.ConvertibleFromIntegerLiteral > etc.. I like it but Dave has already expressed that this isn't conversion. This is something distinct, magical, and more importantly, ineffable. He says it means an instance of the typ

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Matthew Johnson via swift-evolution
> On Jun 28, 2016, at 9:05 PM, Erica Sadun wrote: > >> >> On Jun 28, 2016, at 7:52 PM, Matthew Johnson > > wrote: >> >>> >>> On Jun 28, 2016, at 8:35 PM, Erica Sadun via swift-evolution >>> mailto:swift-evolution@swift.org>> wrote: >>> >>> On Jun 28, 201

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Sean Heber via swift-evolution
What about.. Syntax.ConvertibleFromIntegerLiteral etc.. l8r Sean Sent from my iPad > On Jun 28, 2016, at 8:52 PM, Matthew Johnson via swift-evolution > wrote: > > >>> On Jun 28, 2016, at 8:35 PM, Erica Sadun via swift-evolution >>> wrote: >>> >>> On Jun 28, 2016, at 6:13 PM, Dave A

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Erica Sadun via swift-evolution
> On Jun 28, 2016, at 7:52 PM, Matthew Johnson wrote: > >> >> On Jun 28, 2016, at 8:35 PM, Erica Sadun via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> >>> On Jun 28, 2016, at 6:13 PM, Dave Abrahams >> > wrote: Or we're clueless AND it's

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread David Sweeris via swift-evolution
I vote for IntegerParkour :-) Sent from my iPhone > On Jun 28, 2016, at 20:35, Erica Sadun via swift-evolution > wrote: > > >>> On Jun 28, 2016, at 6:13 PM, Dave Abrahams wrote: >>> Or we're clueless AND it's a bad name. >> >> It's possible, but until we have an objective rationale for why

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Matthew Johnson via swift-evolution
> On Jun 28, 2016, at 8:35 PM, Erica Sadun via swift-evolution > wrote: > > >> On Jun 28, 2016, at 6:13 PM, Dave Abrahams > > wrote: >>> Or we're clueless AND it's a bad name. >> >> It's possible, but until we have an objective rationale for why it's bad >> (argume

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Erica Sadun via swift-evolution
> On Jun 28, 2016, at 6:13 PM, Dave Abrahams wrote: >> Or we're clueless AND it's a bad name. > > It's possible, but until we have an objective rationale for why it's bad > (arguments that it seems to imply what turns out to be the actual > meaning of the protocol don't count!), *and* a better a

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Dave Abrahams via swift-evolution
on Tue Jun 28 2016, Erica Sadun wrote: >> On Jun 28, 2016, at 2:57 PM, Dave Abrahams via swift-evolution >> wrote: >> No, it's exactly the opposite, as I keep saying. Conformance to this >> protocol does *not* mean you can initialize the type with a literal. >> Proof: >> > >> func f() -> T

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Erica Sadun via swift-evolution
> On Jun 28, 2016, at 2:57 PM, Dave Abrahams via swift-evolution > wrote: > No, it's exactly the opposite, as I keep saying. Conformance to this > protocol does *not* mean you can initialize the type with a literal. > Proof: > > func f() -> T { >return T(integerLiteral: 43) // Error >

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-28 Thread Dave Abrahams via swift-evolution
on Thu Jun 23 2016, Nate Cook wrote: > I like the namespace-based approach to group these protocols together > and I'm very happy to see some clarification happening in this group > of protocols. However, I don't think the proposed new names > communicate what they need to. The names listed in t

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-27 Thread Ben Rimmington via swift-evolution
> On 27 Jun 2016, at 14:37, Xiaodi Wu wrote: > > DictionaryLiteral seems fine to me; it's as much a dictionary as ArrayLiteral > is an array, right? The `DictionaryLiteral` *structure* isn't a hash table. It's an array of key-value pairs, and allows duplicate keys. Entries are accessed by thei

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-27 Thread Matthew Johnson via swift-evolution
> On Jun 26, 2016, at 10:11 AM, Hooman Mehr wrote: > > Syntax by itself is not clear enough. Appending Initializable makes it too > long. > > We can replace Syntax with LiteralSyntax to clarify. Then we will have: > > extension MyNumber: LiteralSyntax.Integer, LiteralSyntax.Float { /*…*/ } >

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-27 Thread Matthew Johnson via swift-evolution
> On Jun 27, 2016, at 7:40 AM, Ben Rimmington wrote: > > > > CORRECTIONS: > > Find:"ExtendedGraphemeClusterConvertible" > Replace: "ExtendedGraphemeClusterLiteralConvertible" > > Find:"StringInterpolationLiteralConvertible" > Replace

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-27 Thread Xiaodi Wu via swift-evolution
DictionaryLiteral seems fine to me; it's as much a dictionary as ArrayLiteral is an array, right? What's wrong with ExtendedGraphemeCluster? It precisely self-documents what must exist between the double quotes to qualify as such a literal. Plus, we don't have e.g. a single-quoted character type;

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-27 Thread Ben Rimmington via swift-evolution
CORRECTIONS: Find:"ExtendedGraphemeClusterConvertible" Replace: "ExtendedGraphemeClusterLiteralConvertible" Find:"StringInterpolationLiteralConvertible" Replace: "StringInterpolationConvertible" Find:"StringLiteralLiteral" (x5) Rep

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-26 Thread Hooman Mehr via swift-evolution
This is already rejected for not being clear enough. We can express some Double values using integer literal syntax, because integers are a subset of floating point numbers but not the other way around. Representable seems to imply it should work both ways. *LiteralConvertible protocols indicat

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-26 Thread T.J. Usiyan via swift-evolution
what about `*LiteralRepresentable`? On Sun, Jun 26, 2016 at 11:11 AM, Hooman Mehr via swift-evolution < swift-evolution@swift.org> wrote: > Syntax by itself is not clear enough. Appending Initializable makes it too > long. > > We can replace Syntax with LiteralSyntax to clarify. Then we will have

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-26 Thread Hooman Mehr via swift-evolution
Syntax by itself is not clear enough. Appending Initializable makes it too long. We can replace Syntax with LiteralSyntax to clarify. Then we will have: extension MyNumber: LiteralSyntax.Integer, LiteralSyntax.Float { /*…*/ } Better yet, to address the valid concern of doing something so diffe

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-24 Thread Matthew Johnson via swift-evolution
Thanks for the feedback Adrian! > On Jun 24, 2016, at 10:01 AM, Adrian Zubarev via swift-evolution > wrote: > > I don’t like an underscore on public protocols. If we’re not forced to use > the proposed syntax at all it looks strange when you use a type with an > underscore (which to me repres

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-24 Thread Adrian Zubarev via swift-evolution
I don’t like an underscore on public protocols. If we’re not forced to use the proposed syntax at all it looks strange when you use a type with an underscore (which to me represents something for private or internal usage). In Swift we only can use literals for a single direction literal -> type

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-24 Thread Vladimir.S via swift-evolution
+1 from me. If I'll see `struct A : Syntax.NilLiteral {..}` I read this as "`A` could be represented in syntax as nil literal" or even "A could be a nil literal in syntax" On 23.06.2016 18:31, Matthew Johnson via swift-evolution wrote: I have completed a draft of a proposal to move the `*Liter

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread Matthew Johnson via swift-evolution
> On Jun 23, 2016, at 12:26 PM, David Sweeris wrote: > > +1 > > “Syntax” still feels weird, though… > > Oh, so if the idea is that literals don’t have a type, that the “Syntax” > isn’t meant to be exclusively about literals, and that the various > `*LiteralConvertible` protocols only exist t

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread Matthew Johnson via swift-evolution
> On Jun 23, 2016, at 11:43 AM, Nate Cook wrote: > > I like the namespace-based approach to group these protocols together and I'm > very happy to see some clarification happening in this group of protocols. > However, I don't think the proposed new names communicate what they need to. > The

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread David Sweeris via swift-evolution
+1 “Syntax” still feels weird, though… Oh, so if the idea is that literals don’t have a type, that the “Syntax” isn’t meant to be exclusively about literals, and that the various `*LiteralConvertible` protocols only exist to tell the -->compiler<-- what types any given literal can become, what

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread L. Mihalkovic via swift-evolution
What an disturbing name... 'Syntax.xxx' it makes me anticipate basically a proliferation of other: NarrowLittleCornerCase. YetAnotherNameToIsolateSomethingElseFromTheRest. It evokes to me the "File file" naming pattern (compared to 'File settings' or 'File avatarImage') Regards LM (From

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread Nate Cook via swift-evolution
I like the namespace-based approach to group these protocols together and I'm very happy to see some clarification happening in this group of protocols. However, I don't think the proposed new names communicate what they need to. The names listed in the "Alternatives Considered" section do a bet

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Jun 23, 2016, at 10:39 AM, Sean Heber wrote: > > My only feedback at the moment is that “Syntax” seems like a weird name. This name was suggested by the standard library team. I believe the intent is to place all syntax-supporting protocols in it. The only syntax-sup

Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread Sean Heber via swift-evolution
My only feedback at the moment is that “Syntax” seems like a weird name. This is all about literals, right? So why not use: Literal.Integer Literal.Float Literal.String etc. l8r Sean > On Jun 23, 2016, at 10:31 AM, Matthew Johnson via swift-evolution > wrote: > > I have completed a draft o

[swift-evolution] [Proposal Draft] Literal Syntax Protocols

2016-06-23 Thread Matthew Johnson via swift-evolution
I have completed a draft of a proposal to move the `*LiteralConvertible` protocols into a `Syntax` namespace as suggested by the standard library team. The draft can be found here: https://gist.github.com/anandabits/99dad2305d310874bd613b72b14eee56