Re: Address of UFCS call implicity converts to Delegate

2017-04-24 Thread Jonathan Marler via Digitalmars-d
On Monday, 24 April 2017 at 19:19:27 UTC, Meta wrote: On Monday, 24 April 2017 at 15:47:14 UTC, Jonathan Marler wrote: I've added a DIP for this (https://github.com/dlang/DIPs/pull/61). At first I first thought that all we needed was to add semantics to take the address of a UFCS-style call,

Re: Address of UFCS call implicity converts to Delegate

2017-04-24 Thread Meta via Digitalmars-d
On Monday, 24 April 2017 at 15:47:14 UTC, Jonathan Marler wrote: I've added a DIP for this (https://github.com/dlang/DIPs/pull/61). At first I first thought that all we needed was to add semantics to take the address of a UFCS-style call, but after messing around with your example I realized

Re: Address of UFCS call implicity converts to Delegate

2017-04-24 Thread Jonathan Marler via Digitalmars-d
On Monday, 24 April 2017 at 15:47:14 UTC, Jonathan Marler wrote: On Sunday, 23 April 2017 at 17:13:31 UTC, Basile B. wrote: [...] I've added a DIP for this (https://github.com/dlang/DIPs/pull/61). At first I first thought that all we needed was to add semantics to take the address of a UFC

Re: Address of UFCS call implicity converts to Delegate

2017-04-24 Thread Jonathan Marler via Digitalmars-d
On Sunday, 23 April 2017 at 17:13:31 UTC, Basile B. wrote: On Sunday, 23 April 2017 at 17:07:51 UTC, Jonathan Marler wrote: On Sunday, 23 April 2017 at 17:00:59 UTC, Basile B. wrote: 2/ Why not just a member function ? For the same reason that UFCS exists. You can't add "member functions" t

Re: Address of UFCS call implicity converts to Delegate

2017-04-23 Thread Basile B. via Digitalmars-d
On Sunday, 23 April 2017 at 17:07:51 UTC, Jonathan Marler wrote: On Sunday, 23 April 2017 at 17:00:59 UTC, Basile B. wrote: 2/ Why not just a member function ? For the same reason that UFCS exists. You can't add "member functions" to external library types. Good point. I have to say that t

Re: Address of UFCS call implicity converts to Delegate

2017-04-23 Thread Jonathan Marler via Digitalmars-d
On Sunday, 23 April 2017 at 17:00:59 UTC, Basile B. wrote: 2/ Why not just a member function ? For the same reason that UFCS exists. You can't add "member functions" to external library types.

Re: Address of UFCS call implicity converts to Delegate

2017-04-23 Thread Basile B. via Digitalmars-d
On Sunday, 23 April 2017 at 16:32:06 UTC, Jonathan Marler wrote: This feels like a natural extension to existing semantics. It doesn't require new syntax and serves as a solution to some issues when working with delegates. Say some API wants a delegate like this: void delegate(string arg) W

Address of UFCS call implicity converts to Delegate

2017-04-23 Thread Jonathan Marler via Digitalmars-d
This feels like a natural extension to existing semantics. It doesn't require new syntax and serves as a solution to some issues when working with delegates. Say some API wants a delegate like this: void delegate(string arg) With this feature, you could take a function like this: void myCoolF