Re: [swift-evolution] [Idea] custom infix functions

2016-04-22 Thread Vladimir.S via swift-evolution
I don't think we should rely only on XCode editor as Swift is open source now and is used on other systems like Linux where we have no XCode. And IMO language should not rely on any editor. Just my opinion. Probably others will find this idea useful. As for "with". Yes, I understand that this

Re: [swift-evolution] [Idea] custom infix functions

2016-04-22 Thread Adrian Zubarev via swift-evolution
Ooops, my bad, I didn’t scroll your reply to the very end and so I didn’t read your full answer. The custom `with` statement with infix function was just an example that it might be possible to build. It won’t look that 'hacky‘ if Swift would have an explicit protocol for all value types.

Re: [swift-evolution] [Idea] custom infix functions

2016-04-22 Thread Vladimir.S via swift-evolution
On 22.04.2016 22:06, Adrian Zubarev via swift-evolution wrote: I’d like to throw an idea in the room and see where this will go. What if Swift would allow us to create custom infix functions? Does Swift need to ability of infix functions? How powerful can such a feature be? Pros and cons?

Re: [swift-evolution] [Idea] custom infix functions

2016-04-22 Thread Adrian Zubarev via swift-evolution
I must correct myself, I’m a bit sleepy. infix func with(lhs: T, rhs: @noescape (T) -> Void) -> T {     rhs(lhs)     return lhs } This one will do the trick. --  Adrian Zubarev Am 22. April 2016 bei 21:07:00, Adrian Zubarev (adrian.zuba...@devandartist.com) schrieb: I’d like to throw an idea

[swift-evolution] [Idea] custom infix functions

2016-04-22 Thread Adrian Zubarev via swift-evolution
I’d like to throw an idea in the room and see where this will go. What if Swift would allow us to create custom infix functions? Does Swift need to ability of infix functions?  How powerful can such a feature be? Pros and cons? There is a discussion about the `with` statement which we could